cascornelissen / svg-spritemap-webpack-plugin

SVG spritemap plugin for webpack
MIT License
210 stars 51 forks source link

Webpack v5: Plugin is not cleaning up chunk/module correctly #127

Closed cascornelissen closed 4 years ago

cascornelissen commented 4 years ago

@cascornelissen

v3.6.0 create spritemap.js file. Do you have option to delete this file?

Related? #17

Originally posted by @sectsect in https://github.com/cascornelissen/svg-spritemap-webpack-plugin/issues/108#issuecomment-717617447

cascornelissen commented 4 years ago

@sectsect, thanks for reporting the issue, it should be deleted automatically (unless chunk.keep is set to true), there's even a test for it which seems to be green for both Webpack 4 and 5 so I'll investigate manually.

sectsect commented 4 years ago

@cascornelissen

I created a minimal project. (webpack: 5.3.2 / svg-spritemap-webpack-plugin: 3.6.0) https://github.com/sectsect/svg-spritemap-webpack-plugin-test

  1. npm run build
  2. Check directory dist/assets/js
    $ ls src/assets/js
    hello.js
    $ ls dist/assets/js
    hello.js        spritemap.js
    $ cat dist/assets/js/spritemap.js
    (self.webpackChunkhello=self.webpackChunkhello||[]).push([[355],{256:function(){}}]);
cascornelissen commented 4 years ago

This should be fixed in 3.6.1 which is now available under the next dist-tag on NPM.

$ npm install svg-spritemap-webpack-plugin@next

Please test this release out using both Webpack 4 and 5 if possible and report any problems.