Incorrectly cleans up files from file-loader plugin with ./ in name
mobz opened this issue · 3 comments
If the file-loader is used, and there is a ./
in the name, emitted files will be cleaned up by this plugin
To see this behaviour,
Unzip attached project.
npm install && npm run build
You will see two files are emitted, but the svg is not in the dist directory.
If you remove the WebpackCleanupPlugin it will work as expected.
If you remove the ./
from the name part of the file-loader module it will work as expected
Playing around with this bit more, if I change WebpackCleanupPlugin.js:22
to
const assets = stats.toJson().assets.map(asset => path.join(asset.name) );
It resolves the issue, however I'm not sure that's the right thing to do
I've published the fix as v0.4.1
. Feel free to write back if not working as expected.