Working with editors/IDEs supporting “safe write”
Note that many editors support “safe write” feature and have it enabled by default, which makes dev server unable to watch files correctly. “Safe write” means changes are not written directly to original file but to temporary one instead, which is renamed and replaces original file when save operation is completed successfully. This behaviour causes file watcher to lose the track because the original file is removed. In order to prevent this issue, you have to disable “safe write” feature in your editor.
- VIM - set “:set backupcopy=yes” (see documentation)
- IntelliJ - Settings -> System Settings -> Synchronization -> disable “safe write” (may differ in various IntelliJ IDEs, but you can still use the search feature)
Link: http://webpack.github.io/docs/webpack-dev-server.html#hot-mode
时间: 2024-09-29 10:46:06