mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
e6710b0bbd
Updates the dynamic-compiler test to be compatible with the APF v13. As of v13, the packages no longer come with metadata.json files and now need to be processed with the babel linker plugin. This commit sets up the linker plugin, and switches away from the deprecated systemjs approach to a simpler rollup code-splitting variant. PR Close #43431
32 lines
838 B
JavaScript
32 lines
838 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: 'dist/main.js',
|
|
output: {
|
|
format: 'esm',
|
|
dir: 'dist/',
|
|
entryFileNames: '[name].bundle.js',
|
|
sourcemap: true,
|
|
},
|
|
treeshake: true,
|
|
plugins: [
|
|
nodeResolve(),
|
|
babel({plugins: [linkerPlugin]}),
|
|
]
|
|
};
|