@@ -9,59 +9,61 @@ import { defineConfig } from 'rollup'
99
1010const __dirname = path . dirname ( fileURLToPath ( import . meta. url ) )
1111
12- const config = defineConfig ( {
13- external : [ 'vue' ] ,
14- output : {
15- file : path . resolve ( __dirname , './dist/webRouter.js' ) ,
16- format : 'es' ,
17- } ,
18- input : path . resolve ( __dirname , './webRouter.js' ) ,
19- plugins : [
20- replace ( {
21- preventAssignment : true ,
22- values : {
23- __DEV__ : 'false' ,
24- // this is only used during tests
25- __TEST__ : 'false' ,
26- // If the build is expected to run directly in the browser (global / esm builds)
27- __BROWSER__ : 'true' ,
28- // is targeting bundlers?
29- __BUNDLER__ : 'false' ,
30- __GLOBAL__ : 'false' ,
31- // is targeting Node (SSR)?
32- __NODE_JS__ : 'false' ,
33- __VUE_PROD_DEVTOOLS__ : 'false' ,
34- 'process.env.NODE_ENV' : JSON . stringify ( 'production' ) ,
35- } ,
36- } ) ,
37- ts ( {
38- check : false ,
39- tsconfig : path . resolve ( __dirname , '../tsconfig.json' ) ,
40- cacheRoot : path . resolve ( __dirname , '../node_modules/.rts2_cache' ) ,
41- tsconfigOverride : {
42- compilerOptions : {
43- sourceMap : false ,
44- declaration : false ,
45- declarationMap : false ,
12+ const configs = [ 'webRouter' , 'webRouter_experimental' ] . map ( file => {
13+ return defineConfig ( {
14+ external : [ 'vue' ] ,
15+ output : {
16+ file : path . resolve ( __dirname , `./dist/${ file } .js` ) ,
17+ format : 'es' ,
18+ } ,
19+ input : path . resolve ( __dirname , `./${ file } .js` ) ,
20+ plugins : [
21+ replace ( {
22+ preventAssignment : true ,
23+ values : {
24+ __DEV__ : 'false' ,
25+ // this is only used during tests
26+ __TEST__ : 'false' ,
27+ // If the build is expected to run directly in the browser (global / esm builds)
28+ __BROWSER__ : 'true' ,
29+ // is targeting bundlers?
30+ __BUNDLER__ : 'false' ,
31+ __GLOBAL__ : 'false' ,
32+ // is targeting Node (SSR)?
33+ __NODE_JS__ : 'false' ,
34+ __VUE_PROD_DEVTOOLS__ : 'false' ,
35+ 'process.env.NODE_ENV' : JSON . stringify ( 'production' ) ,
4636 } ,
47- exclude : [ '__tests__' , 'test-dts' ] ,
48- } ,
49- } ) ,
50- resolve ( ) ,
51- commonjs ( ) ,
52- terser ( {
53- // uncomment to debug output size changes
54- // mangle: false,
55- format : {
56- comments : false ,
57- } ,
58- module : true ,
59- compress : {
60- ecma : 2015 ,
61- pure_getters : true ,
62- } ,
63- } ) ,
64- ] ,
37+ } ) ,
38+ ts ( {
39+ check : false ,
40+ tsconfig : path . resolve ( __dirname , '../tsconfig.json' ) ,
41+ cacheRoot : path . resolve ( __dirname , '../node_modules/.rts2_cache' ) ,
42+ tsconfigOverride : {
43+ compilerOptions : {
44+ sourceMap : false ,
45+ declaration : false ,
46+ declarationMap : false ,
47+ } ,
48+ exclude : [ '__tests__' , 'test-dts' ] ,
49+ } ,
50+ } ) ,
51+ resolve ( ) ,
52+ commonjs ( ) ,
53+ terser ( {
54+ // uncomment to debug output size changes
55+ // mangle: false,
56+ format : {
57+ comments : false ,
58+ } ,
59+ module : true ,
60+ compress : {
61+ ecma : 2015 ,
62+ pure_getters : true ,
63+ } ,
64+ } ) ,
65+ ] ,
66+ } )
6567} )
6668
67- export default config
69+ export default configs
0 commit comments