|
1 | 1 | load("@aspect_rules_js//js:defs.bzl", "js_library") |
2 | | -load("@npm//@bazel/rollup:index.bzl", "rollup_bundle") |
| 2 | +load("@npm2//:rollup/package_json.bzl", rollup = "bin") |
3 | 3 | load("//tools:defaults.bzl", "pkg_npm") |
4 | 4 | load("//tools:defaults2.bzl", "ts_config") |
5 | 5 |
|
@@ -61,46 +61,98 @@ pkg_npm( |
61 | 61 | ], |
62 | 62 | ) |
63 | 63 |
|
64 | | -rollup_bundle( |
| 64 | +bundle_entrypoints = [ |
| 65 | + [ |
| 66 | + "inject-migration", |
| 67 | + "packages/core/schematics/ng-generate/inject-migration/index.js", |
| 68 | + ], |
| 69 | + [ |
| 70 | + "route-lazy-loading", |
| 71 | + "packages/core/schematics/ng-generate/route-lazy-loading/index.js", |
| 72 | + ], |
| 73 | + [ |
| 74 | + "standalone-migration", |
| 75 | + "packages/core/schematics/ng-generate/standalone-migration/index.js", |
| 76 | + ], |
| 77 | + [ |
| 78 | + "cleanup-unused-imports", |
| 79 | + "packages/core/schematics/ng-generate/cleanup-unused-imports/index.js", |
| 80 | + ], |
| 81 | + [ |
| 82 | + "signals", |
| 83 | + "packages/core/schematics/ng-generate/signals/index.js", |
| 84 | + ], |
| 85 | + [ |
| 86 | + "signal-input-migration", |
| 87 | + "packages/core/schematics/ng-generate/signal-input-migration/index.js", |
| 88 | + ], |
| 89 | + [ |
| 90 | + "signal-queries-migration", |
| 91 | + "packages/core/schematics/ng-generate/signal-queries-migration/index.js", |
| 92 | + ], |
| 93 | + [ |
| 94 | + "output-migration", |
| 95 | + "packages/core/schematics/ng-generate/output-migration/index.js", |
| 96 | + ], |
| 97 | + [ |
| 98 | + "self-closing-tags-migration", |
| 99 | + "packages/core/schematics/ng-generate/self-closing-tags-migration/index.js", |
| 100 | + ], |
| 101 | + [ |
| 102 | + "inject-flags", |
| 103 | + "packages/core/schematics/migrations/inject-flags/index.js", |
| 104 | + ], |
| 105 | + [ |
| 106 | + "test-bed-get", |
| 107 | + "packages/core/schematics/migrations/test-bed-get/index.js", |
| 108 | + ], |
| 109 | + [ |
| 110 | + "document-core", |
| 111 | + "packages/core/schematics/migrations/document-core/index.js", |
| 112 | + ], |
| 113 | + [ |
| 114 | + "control-flow-migration", |
| 115 | + "packages/core/schematics/migrations/control-flow-migration/index.js", |
| 116 | + ], |
| 117 | +] |
| 118 | + |
| 119 | +rollup.rollup( |
65 | 120 | name = "bundles", |
66 | | - config_file = ":rollup.config.js", |
67 | | - entry_points = { |
68 | | - "//packages/core/schematics/ng-generate/inject-migration:index.ts": "inject-migration", |
69 | | - "//packages/core/schematics/ng-generate/route-lazy-loading:index.ts": "route-lazy-loading", |
70 | | - "//packages/core/schematics/ng-generate/standalone-migration:index.ts": "standalone-migration", |
71 | | - "//packages/core/schematics/ng-generate/cleanup-unused-imports:index.ts": "cleanup-unused-imports", |
72 | | - "//packages/core/schematics/ng-generate/signals:index.ts": "signals", |
73 | | - "//packages/core/schematics/ng-generate/signal-input-migration:index.ts": "signal-input-migration", |
74 | | - "//packages/core/schematics/ng-generate/signal-queries-migration:index.ts": "signal-queries-migration", |
75 | | - "//packages/core/schematics/ng-generate/output-migration:index.ts": "output-migration", |
76 | | - "//packages/core/schematics/ng-generate/self-closing-tags-migration:index.ts": "self-closing-tags-migration", |
77 | | - "//packages/core/schematics/migrations/inject-flags:index.ts": "inject-flags", |
78 | | - "//packages/core/schematics/migrations/test-bed-get:index.ts": "test-bed-get", |
79 | | - "//packages/core/schematics/migrations/document-core:index.ts": "document-core", |
80 | | - "//packages/core/schematics/migrations/control-flow-migration:index.ts": "control-flow-migration", |
81 | | - }, |
82 | | - format = "cjs", |
83 | | - link_workspace_root = True, |
84 | | - output_dir = True, |
85 | | - sourcemap = "false", |
| 121 | + srcs = [ |
| 122 | + "rollup.config.js", |
| 123 | + "//:node_modules/@rollup/plugin-commonjs", |
| 124 | + "//:node_modules/@rollup/plugin-node-resolve", |
| 125 | + "//:node_modules/magic-string", |
| 126 | + "//:node_modules/semver", |
| 127 | + "//packages/core/schematics:tsconfig_build", |
| 128 | + "//packages/core/schematics/migrations/control-flow-migration:control-flow-migration_rjs", |
| 129 | + "//packages/core/schematics/migrations/document-core:document-core_rjs", |
| 130 | + "//packages/core/schematics/migrations/inject-flags:inject-flags_rjs", |
| 131 | + "//packages/core/schematics/migrations/test-bed-get:test-bed-get_rjs", |
| 132 | + "//packages/core/schematics/ng-generate/cleanup-unused-imports:cleanup-unused-imports_rjs", |
| 133 | + "//packages/core/schematics/ng-generate/inject-migration:inject-migration_rjs", |
| 134 | + "//packages/core/schematics/ng-generate/output-migration:output-migration_rjs", |
| 135 | + "//packages/core/schematics/ng-generate/route-lazy-loading:route-lazy-loading_rjs", |
| 136 | + "//packages/core/schematics/ng-generate/self-closing-tags-migration:self-closing-tags-migration_rjs", |
| 137 | + "//packages/core/schematics/ng-generate/signal-input-migration:signal-input-migration_rjs", |
| 138 | + "//packages/core/schematics/ng-generate/signal-queries-migration:signal-queries-migration_rjs", |
| 139 | + "//packages/core/schematics/ng-generate/signals:signals_rjs", |
| 140 | + "//packages/core/schematics/ng-generate/standalone-migration:standalone-migration_rjs", |
| 141 | + "//tools/bazel/rollup:path-plugin", |
| 142 | + ], |
| 143 | + args = [ |
| 144 | + "--format=cjs", |
| 145 | + "--config=$(rootpath rollup.config.js)", |
| 146 | + "--dir=packages/core/schematics/bundles", |
| 147 | + "--no-sourcemap", |
| 148 | + ] + ["--input=%s=%s" % (name, path) for [ |
| 149 | + name, |
| 150 | + path, |
| 151 | + ] in bundle_entrypoints], |
| 152 | + out_dirs = [ |
| 153 | + "bundles", |
| 154 | + ], |
86 | 155 | visibility = [ |
87 | 156 | "//packages/core/schematics/test:__pkg__", |
88 | 157 | ], |
89 | | - deps = [ |
90 | | - "//packages/core/schematics/migrations/control-flow-migration", |
91 | | - "//packages/core/schematics/migrations/document-core", |
92 | | - "//packages/core/schematics/migrations/inject-flags", |
93 | | - "//packages/core/schematics/migrations/test-bed-get", |
94 | | - "//packages/core/schematics/ng-generate/cleanup-unused-imports", |
95 | | - "//packages/core/schematics/ng-generate/inject-migration", |
96 | | - "//packages/core/schematics/ng-generate/output-migration", |
97 | | - "//packages/core/schematics/ng-generate/route-lazy-loading", |
98 | | - "//packages/core/schematics/ng-generate/self-closing-tags-migration", |
99 | | - "//packages/core/schematics/ng-generate/signal-input-migration", |
100 | | - "//packages/core/schematics/ng-generate/signal-queries-migration", |
101 | | - "//packages/core/schematics/ng-generate/signals", |
102 | | - "//packages/core/schematics/ng-generate/standalone-migration", |
103 | | - "@npm//@rollup/plugin-commonjs", |
104 | | - "@npm//@rollup/plugin-node-resolve", |
105 | | - ], |
106 | 158 | ) |
0 commit comments