Application restarted on save without changes #1096
Description
Environment
Provide version numbers for the following components (information can be retrieved by running tns info
in your project folder or by inspecting the package.json
of the project):
-
CLI: 6.2.0
-
Cross-platform modules:
-
Android Runtime:
-
iOS Runtime:
-
Plugin(s):
-
Node.js:
-
Please, attach your package.json and webpack.config.js as these configurations are usually critical for investigating issues with webpack
Describe the bug
Run an application. Open any file and just pres ctrl+s
. This will trigger a webpack build and restart the application on the device.
To Reproduce
1 tns run android/ios
2 Open file
3 ctrl+s
Expected behavior
Nothing to happen on ctrl+s
when there are no modifications in the file.
Sample project
Additional context
When there are no changes (timestamps are not modified) the chunk is taken from the cache. The cached asset object has the property existsAt
set and this will prevent the emit of that chunk - https://github.com/webpack/webpack/blob/4056506488c1e071dfc9a0127daa61bf531170bf/lib/Compiler.js#L326. However when we replace the whole asset, the flag is no longer set and the chunk is emmited every time.