0
votes

I have this configuration in my webpack.config.js

vendors : {
    test : /[\\/]node_modules[\\/]/,
    chunks: 'initial',
    name: 'vendors',
    priority: 10,
    enforce: true,
    minChunks : 2,
},

which worked fine when the node_modules were inside the project folder. Now, I have moved the node_modules to the parent folder to share it among other projects. However, the vendors.js file is not created.

I experimenting with the line test : /[\\/]node_modules[\\/]/ but no success. I assume I need to update this line, so that webpack checks the parent folder for modules.

Any advice, please?

1

1 Answers

1
votes

Have you tried doing something like this. Because if you dont put slash then node will search for node modules in parent directory.

test : /node_modules[\/]/,

Check this out https://github.com/nodejs/help/issues/681