Skip to content

fix-next(prepare): clean platforms/.../app/ on bundle #3464

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

Closed
wants to merge 1 commit into from

Conversation

sis0k0
Copy link
Contributor

@sis0k0 sis0k0 commented Mar 15, 2018

If prepare of the project is required and the bundle option is passed,
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.

fixes NativeScript/nativescript-dev-webpack#463

If prepare of the project is required and the bundle option is passed,
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.

fixes NativeScript/nativescript-dev-webpack#463
@sis0k0 sis0k0 requested a review from Mitko-Kerezov March 15, 2018 15:16
@dtopuzov
Copy link
Contributor

run ci

@sis0k0
Copy link
Contributor Author

sis0k0 commented Mar 17, 2018

This method is ran whenever a change is detected and that's why the dist dir shouldn't be cleaned here. CLosing in favor of NativeScript/nativescript-dev-webpack#465

@sis0k0 sis0k0 closed this Mar 17, 2018
@sis0k0 sis0k0 deleted the sis0k0/clean-app-dir-on-bundle branch March 17, 2018 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

when you bundle with snapshot and then bundle without it, you will see exception in release
2 participants