Skip to content
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

Add watch and cleanOnApply options #35

Conversation

OJezu
Copy link

@OJezu OJezu commented Nov 7, 2016

Has tests, by default is backward compatible. Fixes #29. Alternative to #32.

TODO:
When watching, keep list of files generated in previous compilation, and upon "emit" or "done" remove those, which are not present in current compilation.

@coveralls
Copy link

coveralls commented Nov 7, 2016

Coverage Status

Coverage increased (+0.5%) to 94.286% when pulling 70b808e on OJezu:feature/add-watch-and-cleanOnApply-options into 4ae2022 on johnagan:master.

@nassimbenkirane
Copy link

Hi !
I'm looking for a similar functionality for my project. Unfortunately it doesn't work as expected when you have multiple entry points in your webpack config. A partial update on the watched files, will delete the other files ...

Example, if I have

dist/foo.bundle.js
dist/bar.bundle.js

If i change a file that is in foo, but not in bar, using {watch: true}, I will only have

dist/foo.bundle.js

and bar.bundle.js will have disappeared

@OJezu
Copy link
Author

OJezu commented Nov 25, 2016

@nassimbenkirane

Does this also happen without {watch: true} or does it work as expected then?
As I said in TODO, full implementation should track which file were built previously and delete only them.

@aikar
Copy link

aikar commented Jan 17, 2017

After reviewing both of these PR's, I decided to go another route and make my own plugin for now:
https://github.com/aikar/webpack-auto-clean-build-plugin

But I think this plugin should be modified to support this style of cleaning my plugin is providing AFTER the initial compile.

It should:
on webpack, pre first compile: wipe full
on incremental compile (webpack watch mode), remove abandoned chunks as my plugin is doing.

If this plugin is updated to support this (to not wipe entire build folder every compile), then i wouldn't need mine.

I don't think this plugin needs new config options for watch/apply. It should just do it.

@johnagan
Copy link
Owner

Sorry for the delay @OJezu - I'm happy to bring this in if we can resolve the conflicts.

@OJezu
Copy link
Author

OJezu commented Jan 20, 2017

I need first to do some additional testing, I was using this a bit, and I noticed some possible issues.

@johnagan
Copy link
Owner

Closing in favor of #32

@johnagan johnagan closed this Mar 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants