|
| 1 | +diff --git node_modules/@angular/bazel/src/ng_package/_BUILD.bazel node_modules/@angular/bazel/src/ng_package/_BUILD.bazel |
| 2 | +index e7cf3d9..1887e95 100644 |
| 3 | +--- node_modules/@angular/bazel/src/ng_package/_BUILD.bazel |
| 4 | ++++ node_modules/@angular/bazel/src/ng_package/_BUILD.bazel |
| 5 | +@@ -2,6 +2,14 @@ package(default_visibility = ["//visibility:public"]) |
| 6 | + |
| 7 | + load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary") |
| 8 | + |
| 9 | ++nodejs_binary( |
| 10 | ++ name = "rollup_bin", |
| 11 | ++ entry_point = "rollup_bin.js", |
| 12 | ++ data = [ |
| 13 | ++ "rollup_bin.js", |
| 14 | ++ ], |
| 15 | ++ node_modules = "@build_bazel_rules_nodejs_rollup_deps//:node_modules", |
| 16 | ++) |
| 17 | + |
| 18 | + nodejs_binary( |
| 19 | + name = "packager", |
| 20 | +diff --git node_modules/@angular/bazel/src/ng_package/ng_package.bzl node_modules/@angular/bazel/src/ng_package/ng_package.bzl |
| 21 | +index f3104f0..bb0c04f 100644 |
| 22 | +--- node_modules/@angular/bazel/src/ng_package/ng_package.bzl |
| 23 | ++++ node_modules/@angular/bazel/src/ng_package/ng_package.bzl |
| 24 | +@@ -102,6 +102,13 @@ def _rollup(ctx, bundle_name, rollup_config, entry_point, inputs, js_output, for |
| 25 | + map_output = ctx.actions.declare_file(js_output.basename + ".map", sibling = js_output) |
| 26 | + |
| 27 | + args = ctx.actions.args() |
| 28 | ++ |
| 29 | ++ # Pass arguments through a parameter file. This is necessary because on Windows there is |
| 30 | ++ # an argument limit and we there might be a lot of globals which need to be passed to |
| 31 | ++ # rollup. We always enable it because Bazel is not able to properly detect the argument limit. |
| 32 | ++ # Read more here: https://docs.bazel.build/versions/master/skylark/lib/Args.html#use_param_file |
| 33 | ++ args.use_param_file(param_file_arg = "%s", use_always = True) |
| 34 | ++ |
| 35 | + args.add("--config", rollup_config) |
| 36 | + |
| 37 | + args.add("--input", entry_point) |
| 38 | +@@ -435,7 +442,7 @@ NG_PACKAGE_ATTRS = dict(NPM_PACKAGE_ATTRS, **dict(ROLLUP_ATTRS, **{ |
| 39 | + cfg = "host", |
| 40 | + ), |
| 41 | + "_rollup": attr.label( |
| 42 | +- default = Label("@build_bazel_rules_nodejs//internal/rollup"), |
| 43 | ++ default = Label("@npm_angular_bazel//src/ng_package:rollup_bin"), |
| 44 | + executable = True, |
| 45 | + cfg = "host", |
| 46 | + ), |
| 47 | +diff --git node_modules/@angular/bazel/src/ng_package/rollup_bin.js node_modules/@angular/bazel/src/ng_package/rollup_bin.js |
| 48 | +new file mode 100644 |
| 49 | +index 0000000..9395677 |
| 50 | +--- /dev/null |
| 51 | ++++ b/rollup_bin.js |
| 52 | +@@ -0,0 +1,11 @@ |
| 53 | ++const fs = require('fs'); |
| 54 | ++ |
| 55 | ++const args = process.argv.slice(2); |
| 56 | ++const rollupArgs = fs.readFileSync(args[0], 'utf8').trim().split('\n'); |
| 57 | ++ |
| 58 | ++// Overwrite the process arguments so that the rollup binary uses the |
| 59 | ++// proper argument passed from the Bazel action. |
| 60 | ++process.argv = [process.argv[0], process.argv[1], ...rollupArgs]; |
| 61 | ++ |
| 62 | ++// Run rollup by requiring the binary entry-point. |
| 63 | ++require('rollup/bin/rollup'); |
0 commit comments