build: update to rules nodejs 1.0.1 (#34589)

This brings in a few minor fixes including a better way to patch require for bootstrap scripts.

PR Close #34589
This commit is contained in:
Greg Magolan
2020-01-02 19:05:47 -08:00
committed by atscott
parent 1ba6fd3f42
commit 8042433cb0
16 changed files with 95 additions and 116 deletions

View File

@ -6,13 +6,10 @@
* found in the LICENSE file at https://angular.io/license
*/
if (process.env['TEST_SRCDIR']) {
// bootstrap the bazel require resolve patch since this
// script is a bootstrap script loaded with --node_options=--require=...
const path = require('path');
require(path.posix.join(
process.env['TEST_SRCDIR'], process.env['TEST_WORKSPACE'],
(process.env['TEST_BINARY'] as string).replace(/\.(sh|bat)$/, '_loader.js'), ));
// bootstrap the bazel require patch since this bootstrap script is loaded with
// `--node_options=--require=$(rlocation $(location script.js))`
if (process.env['BAZEL_NODE_RUNFILES_HELPER']) {
require(process.env['BAZEL_NODE_RUNFILES_HELPER'] as string).patchRequire();
}
import 'zone.js/lib/node/rollup-main';