Failing to clean dummy-chunk on some occasions
See original GitHub issueUsing webpack 4.x
, svg-spritemap-webpack-plugin 3.3.5
, Webpack configuration is something like this:
module.exports = {
mode: "development",
output: {
path: path.resolve(context,"./dist"),
filename: "code.bundle.js",
//chunkFilename: "[id].js",
publicPath: ""
},
plugins: [
new SVGSpritemapPlugin('./editor/assets/svg/*.svg',{
output: {
filename: "symbol-defs.svg",
svg4everybody: false
},
sprite: {
prefix: "icon-"
}
})
]
}
If I define output.filename
as a string without any placeholders, dummy module’s chunk uses that string as a postfix to define its filename. This causes the internal check to remove the dummy chunk fail.
compilation.chunks.forEach((chunk) => {
if ( chunk.name !== outputOptions.chunk.name ) {
return;
}
// chunk.name is 'spritemap' while chunk filename is 'spritemap.code.bundle.js'
chunk.files.filter((file) => {
return [`${chunk.name}.js`, `${chunk.name}.js.map`].includes(file);
}).forEach((file) => {
delete compilation.assets[file];
});
});
It can be easily fixed if you define a output.filename
with placeholders or define output.chunkFilename
. Latter is the one I preffered. Not sure if this is considered nitpicking.
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
PoC||GTFO - Alex Omar
The FAIL. Needless to say, what followed was a tense afternoon of drinking, waiting, and considering exit scenarios from a certain country,.
Read more >Switch (back) to copying full CPython Lib until we get to a ...
(SerialCookie can yield some strange-looking cookie +values, however.) ... If it fails, then it fallsback to treating the value +as a string.
Read more >Full text of "Your Computer Magazine (July 1985)"
Behind Sinclair *s cash crisis lie many reasons, some common to all ... If a program does not load as easily on the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@Maiquu, a fix for this issue has been released in version
3.3.6
🚀Thanks for your quick response as well! I’ll leave the issue open until I release a new patch version containing the fix ✌️