ribesg
02/24/2020, 8:12 PMwebpack.config.d/chunk.js
config.optimization = {
moduleIds: 'hashed',
runtimeChunk: 'single',
splitChunks: {
cacheGroups: {
vendor: {
test: /[\\/]node_modules[\\/]/,
name: function(module) {
const packageName = module.context.match(/[\\/]node_modules[\\/](.*?)([\\/]|$)/)[1];
return `npm.${packageName.replace('@', '')}`;
}
}
}
}
};
And here's the matching webpack.evaluated.config.js
part:
optimization: {
moduleIds: 'hashed',
runtimeChunk: 'single',
splitChunks: {
cacheGroups: {
vendor: {
test: /[\\\/]node_modules[\\\/]/,
name: [Function: name]
}
}
}
}
What should I do with that?turansky
02/24/2020, 8:21 PM1.3.61
?ribesg
02/24/2020, 8:23 PMribesg
02/24/2020, 8:23 PMribesg
02/24/2020, 8:24 PMturansky
02/24/2020, 10:57 PM1.3.70-eap-274
- no problem detected (possibly resolved).Ilya Goncharov [JB]
02/25/2020, 8:46 AMbuild/js/packages/module-name/webpack.config.js
webpack.evaluated.config.js
is only for debug issues because it is convinient way to get real declarative webpack config.
What exactly the problem? How do you use this file?ribesg
02/25/2020, 9:38 AMevaluated
content isn’t right but the right code is still executed. I thought it was not working because it actually wasn’t on Windows, I guess the function’s regex don’t work on Windows for some reason.
It’s weird because the regexes do use [\\/]
as file separator...