-
-
Notifications
You must be signed in to change notification settings - Fork 195
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Start LiveSync watcher earlier during run #3404
Comments
sis0k0
added a commit
to NativeScript/nativescript-dev-webpack
that referenced
this issue
Mar 17, 2018
Every time we are running a new build with webpack the platforms/.../app/ dir should be deleted as there may be old assets left. Ex. When the app bundled with snapshot enabled: ``` tns build android --bundle --env.snapshot ``` this produces some assets: ``` platforms/android/.../app/vendor.js platforms/android/.../app/_embedded_script.js // ... ``` Then, if the project is bundled without snapshot: ``` tns build android --bundle ``` the produced assets will override the ones that are already in `platforms/android/.../app`. However, since the build is without snapshot, an `_embedded_script.js` won't be generated to override the one that's left in `platforms/android/.../app` from the previous build. We'll be using `CleanWebpackPlugin` to clean the dist folder. ** Important **: Currently we're running two webpack builds when doing `tns run android|ios` - one on prepare and one when the watcher starts. This means that the dist folder will be cleaned two times. This will be resolved when NativeScript/nativescript-cli#3404 is implemented. fixes #463
sis0k0
added a commit
to NativeScript/nativescript-dev-webpack
that referenced
this issue
Mar 21, 2018
Every time we are running a new build with webpack the platforms/.../app/ dir should be deleted as there may be old assets left. Ex. When the app bundled with snapshot enabled: ``` tns build android --bundle --env.snapshot ``` this produces some assets: ``` platforms/android/.../app/vendor.js platforms/android/.../app/_embedded_script.js // ... ``` Then, if the project is bundled without snapshot: ``` tns build android --bundle ``` the produced assets will override the ones that are already in `platforms/android/.../app`. However, since the build is without snapshot, an `_embedded_script.js` won't be generated to override the one that's left in `platforms/android/.../app` from the previous build. We'll be using `CleanWebpackPlugin` to clean the dist folder. ** Important **: Currently we're running two webpack builds when doing `tns run android|ios` - one on prepare and one when the watcher starts. This means that the dist folder will be cleaned two times. This will be resolved when NativeScript/nativescript-cli#3404 is implemented. fixes #463
sis0k0
added a commit
to NativeScript/nativescript-dev-webpack
that referenced
this issue
Mar 21, 2018
Every time we are running a new build with webpack the platforms/.../app/ dir should be deleted as there may be old assets left. Ex. When the app bundled with snapshot enabled: ``` tns build android --bundle --env.snapshot ``` this produces some assets: ``` platforms/android/.../app/vendor.js platforms/android/.../app/_embedded_script.js // ... ``` Then, if the project is bundled without snapshot: ``` tns build android --bundle ``` the produced assets will override the ones that are already in `platforms/android/.../app`. However, since the build is without snapshot, an `_embedded_script.js` won't be generated to override the one that's left in `platforms/android/.../app` from the previous build. We'll be using `CleanWebpackPlugin` to clean the dist folder. ** Important **: Currently we're running two webpack builds when doing `tns run android|ios` - one on prepare and one when the watcher starts. This means that the dist folder will be cleaned two times. This will be resolved when NativeScript/nativescript-cli#3404 is implemented. fixes #463
sis0k0
added a commit
to NativeScript/nativescript-dev-webpack
that referenced
this issue
Mar 22, 2018
Every time we are running a new build with webpack the platforms/.../app/ dir should be deleted as there may be old assets left. Ex. When the app bundled with snapshot enabled: ``` tns build android --bundle --env.snapshot ``` this produces some assets: ``` platforms/android/.../app/vendor.js platforms/android/.../app/_embedded_script.js // ... ``` Then, if the project is bundled without snapshot: ``` tns build android --bundle ``` the produced assets will override the ones that are already in `platforms/android/.../app`. However, since the build is without snapshot, an `_embedded_script.js` won't be generated to override the one that's left in `platforms/android/.../app` from the previous build. We'll be using `CleanWebpackPlugin` to clean the dist folder. ** Important **: Currently we're running two webpack builds when doing `tns run android|ios` - one on prepare and one when the watcher starts. This means that the dist folder will be cleaned two times. This will be resolved when NativeScript/nativescript-cli#3404 is implemented. fixes #463
sis0k0
added a commit
to NativeScript/nativescript-dev-webpack
that referenced
this issue
Mar 22, 2018
Every time we are running a new build with webpack the platforms/.../app/ dir should be deleted as there may be old assets left. Ex. When the app bundled with snapshot enabled: ``` tns build android --bundle --env.snapshot ``` this produces some assets: ``` platforms/android/.../app/vendor.js platforms/android/.../app/_embedded_script.js // ... ``` Then, if the project is bundled without snapshot: ``` tns build android --bundle ``` the produced assets will override the ones that are already in `platforms/android/.../app`. However, since the build is without snapshot, an `_embedded_script.js` won't be generated to override the one that's left in `platforms/android/.../app` from the previous build. We'll be using `CleanWebpackPlugin` to clean the dist folder. ** Important **: Currently we're running two webpack builds when doing `tns run android|ios` - one on prepare and one when the watcher starts. This means that the dist folder will be cleaned two times. This will be resolved when NativeScript/nativescript-cli#3404 is implemented. fixes #463
Fatme
added a commit
that referenced
this issue
May 11, 2018
Fatme
added a commit
that referenced
this issue
May 11, 2018
5 tasks
Fatme
added a commit
that referenced
this issue
May 11, 2018
Fatme
added a commit
that referenced
this issue
May 11, 2018
Fatme
added a commit
that referenced
this issue
May 14, 2018
Fatme
added a commit
that referenced
this issue
May 14, 2018
Fatme
added a commit
that referenced
this issue
May 15, 2018
Fatme
added a commit
that referenced
this issue
May 15, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently whenever
tns run <platform>
is executed the logic in CLI is as follows:platforms
, LiveSyncing files if needed, building and installing if required)This logic leads to some issues:
before-prepare
hooks which trigger some compilation for example andbefore-watch
hook, which starts some other watch process and the project files end up undergoing the same process twiceThe proposed solution to this is to invert the logic and start the watcher initially and then force the first preparation. This will eliminate the aforementioned issues in all plugins (
nativescript-dev-typescript
,nativescript-dev-sass
,nativescript-dev-webpack
, etc.). There is also an additional benefit to be gained with this approach - during the very first build of the project the user may make changes to the project files, which will be taken into account and LiveSynced - this functionality is currently missing.The text was updated successfully, but these errors were encountered: