I'm developing a JavaScript/React application in Intellij Idea and I'm using webpack-dev-server
to incrementally build my files. That means that the dev server is watching the files and if a file gets changes, webpack
rebuilds it. Pretty standard scenario.
Unfortunately, webpack
sometimes decides to ignore certain files. I can change them all I want but webpack
does nothing. I have not been able to determine any pattern on which files get ignored. It's arbitrary. Sometimes I just create a new file and webpack
ignores it.
What is interesting though is that it only happens when I perform the save using Intellij Idea. If I open the file in another editor (for example vim) and save it, the file gets correctly rebuilt. Actually, simple touch file.js
is enough to trigger rebuilding.
I guess there is something wrong in how Intellij Idea saves files. Any ideas?
With IntelliJ IDEA, you can develop modern web, mobile, and desktop applications with JavaScript and Node. js. IntelliJ IDEA also supports React, Angular, Vue. js, and other frameworks and provides tight integration with various tools for web development.
Press Ctrl+Alt+S to open the IDE settings and select Languages & Frameworks | JavaScript | Libraries. On the Libraries page that opens, click Download and in the Download Library dialog that opens, select the required library, and click Download and Install.
From the main menu, select File | Manage IDE Settings | Restore Default Settings. Alternatively, press Shift twice and type Restore default settings . Click Restore and Restart. The IDE will be restarted with the default configuration.
This is due to an IDE feature known as "safe write". When enabled, the IDE will write the changes to a temporary file over the real one. This means webpack's file watching mechanism cannot pick up the changes. Disable this feature to fix the problem. Reference.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With