webpack-node-externals
webpack-node-externals copied to clipboard
Option 'includeAbsolutePaths' can't work well with inline loader
Hi, there. I found an interesting case that can be consistently reproduced. If I specify option 'includeAbsolutePaths' and use an inline loader which contains a sub path '/node_modules/', webpack-node-externals
would mistakenly externalize the target file that should be imported. For example:
// webpack.config.js
...
externals: [nodeExternals({ includeAbsolutePaths: true })],
...
// entry file
import { greeting } from '!../node_modules/babel-loader/lib/index.js!./constants';
In this case, the file constants
should be imported but in fact it's externalized. I created a repo licg9999/b6881284 so that you can reproduce the abnormally. Would you help fix it? Or do you mind my fixing it? Thanks.