-
Notifications
You must be signed in to change notification settings - Fork 677
Expand file tree
/
Copy pathbuild.js
More file actions
32 lines (27 loc) · 754 Bytes
/
build.js
File metadata and controls
32 lines (27 loc) · 754 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// TODO: Remove this and change the _phase:build script back to "heft run --only build -- --clean --storybook"
// when we drop support for Node 18
const { Executable, Import } = require('@rushstack/node-core-library');
const heftBinPath = Import.resolveModule({
modulePath: '@rushstack/heft/bin/heft',
baseFolderPath: __dirname
});
const heftArgs = [
heftBinPath,
'run',
'--only',
'build',
'--',
'--clean',
...(process.version.startsWith('v18.')
? [] // Under Node 18, don't run storybook
: ['--storybook'])
];
const { signal, status } = Executable.spawnSync(process.argv0, heftArgs, {
stdio: 'inherit',
environment: process.env
});
if (signal) {
process.kill(process.pid, signal);
} else {
process.exit(status);
}