prophet
prophet copied to clipboard
Webpack 5+ vendors files are not uploaded by Prophet due to ignore list
Describe the bug Prophet has on it's default ignore list the string "node_modules", which is now causing any vendor files compiled by Webpack 5+ to not be uploaded, as Webpack 5+ changed the naming format for vendors JS's and added "node_modules" string on the file name (I know, stupid, source: https://webpack.js.org/guides/code-splitting/
A quick fix I've been doing is basically to edit the Prophet Ignore list on the settings.json and changing from "node_modules" to "node_modules/", but I think that should be fixed on the extension level.
@fleps thanks for reporting. I'll take a look
Hi @fleps, I had the same problem and I've been able to workaround it using webpack:
function normalizeName(name) {
return name.replace(/node_modules/g, "nodemodules").replace(/[\-_.|]+/g, " ")
.replace(/\b(nodemodules|js|modules|es)\b/g, "")
.trim().replace(/ +/g, "-");
}
const webpackConfig = {
// ... other configs
output: {
path: `${__dirname}/cartridges/_name_of_our_custom_cartridge_/cartridge/static/default/js`,
filename: '[name].js',
chunkFilename: function (pathData) {
const name = pathData.chunk.name || pathData.chunk.id;
if (!name.includes('node_modules')) {
return '[name].js';
}
return `${normalizeName(name)}.js`;
},
sourceMapFilename: '[file].map',
}
}
hi @fleps
This should be fixed in 1.4.30
hi @fleps This should be fixed in
1.4.30
Still happening in 1.4.31
.
Hey @SqrTT
The issue still occurs on v1.4.31
I changed the ignore list from node_modules -> node_modules/ as a temp fix.