tsconfig-paths-webpack-plugin
tsconfig-paths-webpack-plugin copied to clipboard
Not working with webpack 5
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
probably duplicated with https://github.com/dividab/tsconfig-paths-webpack-plugin/issues/76
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");