angular/integration/ng_elements/rollup.config.mjs
Alan Agius 6e26af52fa feat(bazel): (APF) Angular Package Format updates (#49559)
Several updates to Angular Package Format.

BREAKING CHANGE:

Several changes to the Angular Package Format (APF)
- Removal of FESM2015
- Replacing ES2020 with ES2022
- Replacing FESM2020 with FESM2022

PR Close #49559
2023-03-23 08:18:45 -07:00

29 lines
996 B
JavaScript

import {nodeResolve} from '@rollup/plugin-node-resolve';
import {babel} from '@rollup/plugin-babel';
import {ConsoleLogger, NodeJSFileSystem, LogLevel} from '@angular/compiler-cli';
import {createEs2015LinkerPlugin} from '@angular/compiler-cli/linker/babel';
/** File system used by the Angular linker plugin. */
const fileSystem = new NodeJSFileSystem();
/** Logger used by the Angular linker plugin. */
const logger = new ConsoleLogger(LogLevel.info);
/** Linker babel plugin. */
const linkerPlugin = createEs2015LinkerPlugin({
fileSystem,
logger,
linkerJitMode: false,
});
export default {
input: './built/src/main.js',
output: {
file: './dist/bundle.js',
},
// Rollup treeshaking has issues with https://github.com/angular/angular/blob/addd7f6249d54e258109f139fad1db0d0250352c/packages/core/src/linker/query_list.ts#L192
// see: https://github.com/rollup/rollup/issues/4895
treeshake: false,
plugins: [
nodeResolve(),
babel({plugins: [linkerPlugin]}),
]
}