@@ -6,28 +6,13 @@ import nodePolyfills from '@rolldown/plugin-node-polyfills';
66// rollup plugins
77import copy from 'rollup-plugin-copy' ;
88import postcss from 'rollup-plugin-postcss' ;
9- import { defineRollupSwcOption , swc } from 'rollup-plugin-swc3' ;
109
1110import path from 'path' ;
1211import { fileURLToPath } from 'url' ;
1312
1413const __filename = fileURLToPath ( import . meta. url ) ;
1514const __dirname = path . dirname ( __filename ) ;
1615
17- const getSwcOptions = ( dirPath : string ) =>
18- defineRollupSwcOption ( {
19- include : / \. [ m c ] ? [ j t ] s x ? $ / ,
20- exclude : 'node_modules' ,
21- tsconfig : production ? `${ dirPath } /tsconfig.json` : `${ dirPath } /tsconfig-dev.json` ,
22- jsc : {
23- transform : { useDefineForClassFields : false } ,
24- minify : {
25- compress : production ? { keep_classnames : true , keep_fnames : true } : false ,
26- mangle : production ? { keep_classnames : true } : false ,
27- } ,
28- } ,
29- } ) ;
30-
3116/**
3217 * Workaround for oxc printer lone-surrogate bug (https://github.com/oxc-project/oxc/issues/3526).
3318 * The oxc codegen replaces lone surrogates (0xD800-0xDFFF) with U+FFFD in long CJS strings,
@@ -63,9 +48,11 @@ export default defineConfig([
6348 output : {
6449 format : 'esm' ,
6550 dir : './lana/out' ,
51+ cleanDir : true ,
6652 chunkFileNames : 'lana-[name].js' ,
6753 sourcemap : false ,
6854 keepNames : true ,
55+ minify : production ,
6956 } ,
7057 tsconfig : production ? './lana/tsconfig.json' : './lana/tsconfig-dev.json' ,
7158 platform : 'node' ,
@@ -76,17 +63,19 @@ export default defineConfig([
7663 } ,
7764
7865 external : [ 'vscode' ] ,
79- plugins : [ preserveAntlrATN ( ) , swc ( getSwcOptions ( './lana' ) ) ] ,
66+ plugins : [ preserveAntlrATN ( ) ] ,
8067 } ,
8168 {
8269 input : { bundle : './log-viewer/src/Main.ts' } ,
8370 output : [
8471 {
8572 format : 'esm' ,
8673 dir : './log-viewer/out' ,
74+ cleanDir : true ,
8775 chunkFileNames : 'log-viewer-[name].js' ,
8876 sourcemap : false ,
8977 keepNames : true ,
78+ minify : production ,
9079 } ,
9180 ] ,
9281 platform : 'browser' ,
@@ -103,7 +92,6 @@ export default defineConfig([
10392 extensions : [ '.css' , '.scss' ] ,
10493 minimize : true ,
10594 } ) ,
106- swc ( getSwcOptions ( './log-viewer' ) ) ,
10795 copy ( {
10896 hook : 'closeBundle' ,
10997 targets : [
0 commit comments