2020-09-09 08:55:19 -04:00
|
|
|
/**
|
|
|
|
* @license
|
|
|
|
* Copyright Google LLC All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by an MIT-style license that can be
|
|
|
|
* found in the LICENSE file at https://angular.io/license
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* This file will be spawned as a separate process when the `ng-dev release build` command is
|
|
|
|
* invoked. A separate process allows us to hide any superfluous stdout output from arbitrary
|
|
|
|
* build commands that we cannot control. This is necessary as the `ng-dev release build` command
|
|
|
|
* supports stdout JSON output that should be parsable and not polluted from other stdout messages.
|
|
|
|
*/
|
|
|
|
|
|
|
|
import {getReleaseConfig} from '../config/index';
|
|
|
|
|
|
|
|
// Start the release package building.
|
2021-05-25 12:42:36 -04:00
|
|
|
main(process.argv[2] === 'true');
|
2020-09-09 08:55:19 -04:00
|
|
|
|
|
|
|
/** Main function for building the release packages. */
|
2021-05-25 12:42:36 -04:00
|
|
|
async function main(stampForRelease: boolean) {
|
2020-09-09 08:55:19 -04:00
|
|
|
if (process.send === undefined) {
|
|
|
|
throw Error('This script needs to be invoked as a NodeJS worker.');
|
|
|
|
}
|
|
|
|
|
|
|
|
const config = getReleaseConfig();
|
2021-05-25 12:42:36 -04:00
|
|
|
const builtPackages = await config.buildPackages(stampForRelease);
|
2020-09-09 08:55:19 -04:00
|
|
|
|
|
|
|
// Transfer the built packages back to the parent process.
|
|
|
|
process.send(builtPackages);
|
|
|
|
}
|