@microsoft/windows-admin-center-sdk
Version:
Microsoft - Windows Admin Center Shell
50 lines (39 loc) • 1.43 kB
text/typescript
import { Utilities } from './utilities';
export module CompileModule {
const argv = Utilities.gulpArgv();
function getBundleArguments(appName: string): string[] {
const args = ['build', appName, '--progress=false', '--extract-licenses=false'];
if (argv['verbose']) { args.push('--verbose'); }
if (argv['prod']) { args.push('--prod'); }
if (argv['watch']) { args.push('--watch'); }
return args;
}
function getServeArguments(): string[] {
const args = ['serve'].concat(process.argv.slice(3));
return args;
}
export function compileLib(cb): any {
const args = ['build', 'module-lib'];
if (argv['prod']) {
args.push('--configuration=production');
if (args.includes('--prod')) {
args.splice(args.indexOf('--prod'), 1);
}
}
Utilities.ng(cb, args);
}
export function bundleApp(cb): void {
const args = getBundleArguments('module-app');
if (argv['prod']) {
args.push('--configuration=production');
if (args.includes('--prod')) {
args.splice(args.indexOf('--prod'), 1);
}
}
Utilities.ng(cb, args);
}
export function serveApp(cb): void {
const args = getServeArguments();
Utilities.ng(cb, args);
}
}