NativeScript / nativescript-dev-webpack

A package to help with webpacking NativeScript apps.
Apache License 2.0
97 stars 49 forks source link

Application restarted on save without changes #1096

Closed KristianDD closed 4 years ago

KristianDD commented 4 years ago

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):

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.