Webpack Rebuilds When Swap Files (*.swp, *.swo, *.swn, ...) Change
See original GitHub issueOS?
Linux (Ubuntu 16.04)
Versions.
@angular/cli: 1.0.0-beta.31 node: 6.9.4 os: linux x64 @angular/common: 4.0.0-beta.7 @angular/compiler: 4.0.0-beta.7 @angular/core: 4.0.0-beta.7 @angular/forms: 4.0.0-beta.7 @angular/http: 4.0.0-beta.7 @angular/platform-browser: 4.0.0-beta.7 @angular/platform-browser-dynamic: 4.0.0-beta.7 @angular/router: 3.4.7 @angular/cli: 1.0.0-beta.31 @angular/compiler-cli: 2.4.7
Repro steps.
- Run
ng serve
- Edit any source file in vim (or similar) but do not save
- Webpack recompiles even though you didn’t save.
- This is most likely due to vim saving any edit to swap files (*.swp, *.swo, *.swn, …). Webpack registers the change to the swap file and triggers the recompilation.
This seems unnecessary and slows down the workflow. When I actually do want to trigger an update, I save the file. However, now I have to wait for the previous (unnecessary) compilation of the swap files to finish before my actual changed files will be compiled again.
Also, webpack constantly recompiles in the background (due to vim saving to the swap files for every new line) which is a little distracting.
Can you configure webpack to ignore common swap files (*.swp, *.swo, *.swn, …) or allow me—the user—to specify, which files to ignore?
I like @angular/cli. I like webpack. I like vim. Can there be peace?
Issue Analytics
- State:
- Created 7 years ago
- Reactions:11
- Comments:11 (4 by maintainers)
@frederikaalund - As a workaround, you could tell vim / neovim to store swap files somewhere else.
Something to the effect of …
This should send all of the
.swp / .swn / .swo
to whatever directory you define & create it if it doesn’t exist. Not quite sure how tight you can make the permissions in vim, the above is what I use with neovim so you may need to tinker a bit.That said, @frederikaalund is correct
.swp$
and it’s counterparts should be excluded for us *nix folks 😃Can this be addressed? I was surprised by this behavior when the builder kicks off any time the swap file gets written.