Skip to content

Commit 9746751

Browse files
gkalpakmhevery
authored andcommitted
build(zone.js): use npm_package.pack to build the Zone.js package (#40592)
Previously, we could not use `npm_package.pack` for building the Zone.js package due to a bug in Windows. This bug has been fixed in version 2.3.0 of `bazelbuild/rules_nodejs`. Now that we have updated `bazelbuild/rules_nodejs` to version 2.3.3 (in #40581) we can replace `npm pack` with `npm_package.pack`. PR Close #40592
1 parent 94e3d3a commit 9746751

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

scripts/build/zone-js-builder.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ function buildZoneJsPackage(destPath) {
3535
console.info(`${scriptPath}:`);
3636
console.info(' Building zone.js npm package');
3737
console.info('##############################');
38-
exec(`${bazelCmd} build //packages/zone.js:npm_package`);
38+
exec(`${bazelCmd} run //packages/zone.js:npm_package.pack`);
3939

4040
// Create the output directory.
4141
const absDestPath = resolve(baseDir, destPath);
@@ -46,12 +46,6 @@ function buildZoneJsPackage(destPath) {
4646
const buildOutputDir = `${bazelBin}/packages/zone.js/npm_package`;
4747
const distTargetDir = `${absDestPath}/zone.js`;
4848

49-
// Also create an archive so we can test the package itself.
50-
// Currently, the `npm_package.pack` rule does not work on Windows, so run `npm pack` directly.
51-
//
52-
// TODO: Switch to `npm_package.pack`, once we upgrade to `bazelbuild/rules_nodejs` >=2.3.0.
53-
exec(`npm pack ${buildOutputDir}`, false, {cwd: baseDir});
54-
5549
console.info(`# Copy npm_package artifacts to ${distTargetDir}`);
5650
rm('-rf', distTargetDir);
5751
cp('-R', buildOutputDir, distTargetDir);

0 commit comments

Comments
 (0)