HMR, and plugin development (npm link) issues #656
Description
Issue Checklist
- You are submitting: a bug report.
- You verified that this is a real problem by searching the [NativeScript Forum] and the other [issues] in this repo.
- You checked our [demo apps] and the [documentation] for sample usage.
Tell us about the problem
HMR works fine for all the files in the app EXCEPT for any files that are in a junction on windows (or symlink on Linux). When you are doing plugin development (including the nativescript-plugin-seed) the directory "../src"
that is symlinked/junctioned is not watched for HMR changes.
You can duplicate this issue by cloning almost any one of my repos that is setup for NS 4 development and has a demo included. The simplist one is https://github.com/NathanaelA/nativescript-localstorage/ and then just add webpack, and do a npm i
and then when you run it with --hmr
enabled; you can try and modify the ../src/localstorage.js
and you will see it is ignored.
This issue stems from this issue: webpack/watchpack#61
Which already has a PR on: webpack/watchpack#72
And a webpack request to expose on: webpack/webpack#6845
Manually changing watchpack source and the followSymlinks: true
allows this to work.
Local environment
- Platform: Windows/Linux (unsure on Mac)
- NativeScript CLI version 4.3.0 - 4.5
- NS-WebPack: 0.17 - 0.24
Project data
- Platform you are building the app for: Android
- Node dependencies:
"dependencies": {
"nativescript-localstorage": "file:../src",
"nativescript-theme-core": "~1.0.4",
"tns-core-modules": "^4.2.0"
},
"devDependencies": {
"babel-traverse": "6.4.5",
"babel-types": "6.4.5",
"babylon": "6.4.5",
"lazy": "1.0.11",
"nativescript-dev-webpack": "^0.17.0-2018-09-12-02"
}
- Webpack configuration:
Unmodified webpack configuration installed by 0.17 & 0.24
Related partially to this issue: NativeScript/nativescript-cli#3890
cc: @vtrifonov