-
-
Notifications
You must be signed in to change notification settings - Fork 198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cleanupOutputBeforeBuild when watching file changes #158
Comments
Hi @timum-viw, I would guess that's caused by the fact that the There is a pending PR that'll allow to configure this plugin more easily (#152) but in the meantime you could try something like this: // webpack.config.js
const Encore = require('@symfony/webpack-encore');
const CleanWebpackPlugin = require('clean-webpack-plugin');
Encore
.setOutputPath('build/')
.setPublicPath('/')
.cleanupOutputBeforeBuild()
// ...
;
const config = Encore.getWebpackConfig();
for (const plugin of config.plugins) {
if ((plugin instanceof CleanWebpackPlugin) && plugin.options) {
plugin.options.watch = true;
}
}
module.exports = config; |
sounds reasonable. the workaround seems to work for now. |
ay, I was a bit quick on the last one. seems like not all files get rebuild. so now I'm missing the files that were unchanged.. |
You're right, it seems that it can't be done using |
Well, cleaning only invalidated files is quite hard to solve actually |
So this is not something we can fix. If clean-webpack-plugin fixes it someday, awesome! So, I'm closing for now! |
I'm not sure if this is wanted behaviour, but when using webpack --watch option the output folder apparently does not get cleared when recompiling after files change, even though I'm using cleanupOutputBeforeBuild. Normally the output files should get overwritten, but since I'm also using enableVersioning option I end up with a whole bunch of versioned files in my output folder.
Any thought about that?
Cheers
The text was updated successfully, but these errors were encountered: