mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
13d3039c7d
Since the Bazel setup in this repo will now always use ESM, the tooling scripts/binaries in AIO need to be switched to ESM too. Most of the scripts are already ESM, but a few had to be converted. Note that the Dgeni generation does not use ESM because it's unaffected and the Dgeni CLI is used. In the future we could also update the Dgeni setup to ESM but there is no need currently. PR Close #48521
34 lines
781 B
JavaScript
34 lines
781 B
JavaScript
/*
|
|
This script serves the aio app, watches for changes,
|
|
and runs a fast dgeni build on any changed files.
|
|
*/
|
|
|
|
import spawn from 'cross-spawn';
|
|
import watchr from '../tools/transforms/authors-package/watchr.js';
|
|
const architectCli = require.resolve('@angular-devkit/architect-cli/bin/architect');
|
|
|
|
const serve = spawn(
|
|
process.execPath,
|
|
[
|
|
'--preserve-symlinks',
|
|
architectCli,
|
|
'site:serve',
|
|
'--open',
|
|
'--poll=1000',
|
|
'--live-reload',
|
|
'--watch',
|
|
],
|
|
{stdio: 'inherit'}
|
|
);
|
|
serve.on('error', (error) => {
|
|
console.error('architect serve script failed');
|
|
console.error(error);
|
|
process.exit(1);
|
|
});
|
|
serve.on('close', (code) => {
|
|
console.error(`architect serve script exited with code ${code}`);
|
|
process.exit(1);
|
|
});
|
|
|
|
watchr.watch(true);
|