diff --git a/bin/ns-bundle b/bin/ns-bundle index 1f8241bd..e2973b2c 100644 --- a/bin/ns-bundle +++ b/bin/ns-bundle @@ -10,9 +10,25 @@ if (!process.env.npm_config_argv) { } const npmArgs = JSON.parse(process.env.npm_config_argv).original; +const tnsArgs = getTnsArgs(npmArgs); const flags = npmArgs.filter(a => a.startsWith("--")).map(a => a.substring(2)); const options = getOptions(flags); +function getTnsArgs(args) { + let other = [ + "run", + "ns-bundle", + "--android", + "--ios", + "--build-app", + "--start-app", + "--uglify", + "--nobundle", + ]; + + return args.filter(a => !other.includes(a)); +} + execute(options); function execute(options) { @@ -41,7 +57,7 @@ function webpack(platform) { function runTns(command, platform) { console.log(`Running tns ${command}...`); return new Promise((resolve, reject) => { - spawnChildProcess("tns", command, platform, "--bundle", "--disable-npm-install") + spawnChildProcess("tns", command, platform, "--bundle", "--disable-npm-install", ...tnsArgs) .then(resolve) .catch(throwError); });