11const copy = require ( 'rollup-plugin-copy' ) ;
22
3- function manualChunks ( id , projectOptions ) {
4- // if (id.includes(projectOptions.main)) {
5- // return;
6- // }
7- // if (
8- // projectOptions.additionalEntryPoints.some((entryPoint) => {
9- // return id.includes(entryPoint);
10- // })
11- // ) {
12- // return;
13- // }
14- if ( id . includes ( '@swc/helpers' ) ) {
15- return 'polyfills' ;
16- }
17- // if (!id.includes('webpack-bundler-runtime')) {
18- // return;
19- // }
20- // if (id.endsWith('types.ts')) {
21- // return;
22- // }
23- // if (id.endsWith('.d.ts')) return;
24- // const cName = id.split('src/')[1].replace('/', '_').replace('.ts', '');
25- // return cName;
26- }
27-
283module . exports = ( rollupConfig , projectOptions ) => {
29- rollupConfig . external = [ / @ m o d u l e - f e d e r a t i o n / ] ;
4+ rollupConfig . external = [ / @ m o d u l e - f e d e r a t i o n \/ r u n t i m e / ] ;
305
316 if ( Array . isArray ( rollupConfig . output ) ) {
327 rollupConfig . output = rollupConfig . output . map ( ( c ) => ( {
338 ...c ,
34- manualChunks : ( id ) => manualChunks ( id , projectOptions ) ,
359 hoistTransitiveImports : false ,
3610 entryFileNames :
3711 c . format === 'esm'
@@ -45,7 +19,6 @@ module.exports = (rollupConfig, projectOptions) => {
4519 } else {
4620 rollupConfig . output = {
4721 ...rollupConfig . output ,
48- manualChunks : ( id ) => manualChunks ( id , projectOptions ) ,
4922 hoistTransitiveImports : false ,
5023 entryFileNames :
5124 rollupConfig . output . format === 'esm'
0 commit comments