A test
can also take a method. This allows a lot of flexibility. For instance.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | vendor: { test(mod/* , chunk */) { // Only node_modules are needed if (!mod.context.includes('node_modules')) { return false; } // But not node modules that contain these key words in the path if ([ 'lodash', 'react'].some(str => mod.context.includes(str))) { return false; } return true; }, name: 'vendor', chunks: 'all', reuseExistingChunk: true }, |
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.