tsconfig-paths-webpack-plugin icon indicating copy to clipboard operation
tsconfig-paths-webpack-plugin copied to clipboard

Not working with webpack 5

Open chaoyangnz opened this issue 2 years ago • 2 comments

I use this plugin with webpack 5. It causes the wrong module resolving.

I have an example repo to reproduce it:

When I enable this plugin in webpack.config.js, check webpack verbose logs, search package.json, you will see package.json in node_modules will be resolved to the package.json in my repo.

When I disable this plugin, the module is resolved correctly.

The repo: https://github.com/chaoyangnz/webpack-5-wrong-module-resolve

chaoyangnz avatar Jul 08 '21 23:07 chaoyangnz

probably duplicated with https://github.com/dividab/tsconfig-paths-webpack-plugin/issues/76

chaoyangnz avatar Jul 08 '21 23:07 chaoyangnz

Run in the same issue. Generated output with plugin:

var _package_json__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../package.json */ "./package.json");

Without plugin:

var _package_json__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../package.json */ "../../../packages/demo.frontend/package.json");

Bessonov avatar Jul 27 '21 13:07 Bessonov