Wepback --watch sees the change but doesn't recompile output file

Viewed 25

I am using npx webpack --watch. When I first run it, it shows many messages with sufix:

[built] [code generated]

Then when I do a change in Data.js file it shows:

[...]
./src/swagger/data.js 3.55 KiB [built] [code generated]
[...]

Until now everything is going as expected. Webpack detected change, recompiled files and put them in the /dist directory.

When I do second change to the Data.js file however, it shows that webpack compiled successfully but it doesn't show [code generated] message and it won't work until I restart npx webpack --watch. Code in /dist directory contains old data.

Basically now it's stuck in a state in which it detects changes but doesn't recompile changed files. Any idea how to force it to recompile this?

I tried adding this to my webpack config but it acts just the same

watchOptions: {
  aggregateTimeout: 600,
  ignored: /node_modules/,
},
0 Answers
Related