Skip to content

Commit 994de0e

Browse files
committed
fix-next(prepare): clean platforms/.../app/ on bundle
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
1 parent 2d96010 commit 994de0e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: lib/services/platform-service.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ export class PlatformService extends EventEmitter implements IPlatformService {
209209
// Always clear up the app directory in platforms if `--bundle` value has changed in between builds or is passed in general
210210
// this is done as user has full control over what goes in platforms when `--bundle` is passed
211211
// and we may end up with duplicate symbols which would fail the build
212-
if (changesInfo.bundleChanged) {
212+
if (changesInfo.bundleChanged || platformInfo.appFilesUpdaterOptions.bundle) {
213213
await this.cleanDestinationApp(platformInfo);
214214
}
215215

0 commit comments

Comments
 (0)