Closed catamphetamine closed 2 years ago
Although having switched from swc-loader
to babel-loader
, I can see the same error in the console.
So maybe the reason is Webpack itself.
Ok, it was a Webpack issue.
A fix is adding resolve.symlinks = false
flag in Webpack config.
resolve: {
// Fix Webpack when using symlinked packages with `npm link`/`yarn link`.
// Prevents Webpack from "expanding" symlinked paths inside `node_modules`
// to actual filesystem paths, so that `node_modules` from the main application
// directory are used instead of searching `node_modules` in the symlinked folders.
symlinks: false
}
I'm looking into moving a hobby pet project from Babel to SWC.
My configuration is:
c:\dev\main-app
c:\dev\util
In order to access the utilities repo code as if it was a
node_module
, I did:It has created a "symlink"
c:/dev/main-app/node_modules/util
→c:/dev/util
.Next, I run the app and it says something like:
At the same time:
c:\dev\main-app\node_modules\regenerator-runtime
package is installed and exists.Looks as if SWC ignored the original (
main-app
) folder when resolvingnode_modules
in a symlinked sibling repo folder.The question is: