91a2506c82
Fixes issue introduced in https://github.com/angular/angular/pull/33808 for ng_rollup_bundle with `-spawn_strategy=standalone`. Without the sandbox (if --spawn_strategy=standalone is set) rollup can resolve to the non-esm .js file generated by ts_library instead of the desired .mjs. This fixes the problem by prioritizing .mjs. Issue observed is of the flavor: ``` ERROR: modules/benchmarks/src/views/BUILD.bazel:20:1: Bundling JavaScript modules/benchmarks/src/views/bundle.es2015.js [rollup] failed (Exit 1) [!] Error: 'enableProdMode' is not exported by bazel-out/darwin-fastbuild/bin/packages/core/index.js https://rollupjs.org/guide/en/#error-name-is-not-exported-by-module bazel-out/darwin-fastbuild/bin/modules/benchmarks/src/views/index.mjs (12:9) 10: * found in the LICENSE file at https://angular.io/license 11: */ 12: import { enableProdMode } from '@angular/core'; ^ 13: import { platformBrowser } from '@angular/platform-browser'; 14: import { ViewsBenchmarkModuleNgFactory } from './views-benchmark.ngfactory'; Error: 'enableProdMode' is not exported by bazel-out/darwin-fastbuild/bin/packages/core/index.js ``` PR Close #33867 |
||
---|---|---|
.. | ||
BUILD.bazel | ||
ng_rollup_bundle.bzl | ||
rollup.config.js |