Skip to content
This repository was archived by the owner on Aug 7, 2021. It is now read-only.

Commit c1f0dbc

Browse files
committed
fix: clean android build artifacts when using with uglify
1 parent dbde299 commit c1f0dbc

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Diff for: bin/ns-bundle

+6-2
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ function cleanBuildArtifacts(platform) {
6969

7070
// for nativescript-cli v3.0.1 and below
7171
// the android build artifacts should be cleaned manually
72-
if (version <= 301) {
72+
if (shouldUglify() || version <= 301) {
7373
gradlewClean().then(resolve).catch(throwError);
7474
} else {
7575
return resolve();
@@ -133,7 +133,7 @@ function webpack(platform) {
133133
`--config=webpack.config.js`,
134134
`--progress`,
135135
`--env.${platform}`,
136-
process.env.npm_config_uglify && `--env.uglify`,
136+
shouldUglify() && `--env.uglify`,
137137
];
138138

139139
spawnChildProcess(...args)
@@ -205,6 +205,10 @@ function spawnChildProcess(command, ...args) {
205205
});
206206
}
207207

208+
function shouldUglify() {
209+
return process.env.npm_config_uglify;
210+
}
211+
208212
function throwError(error) {
209213
console.error(error.message);
210214
process.exit(error.code || 1);

0 commit comments

Comments
 (0)