@@ -16,7 +16,10 @@ const pkg = require('../package.json');
1616
1717const distPath = Path . resolve ( __dirname , '..' , 'dist' ) ;
1818
19- module . exports = ( env = { } , { mode = 'production' } ) => {
19+ const configure = ( { name, vueVersion} ) => ( env = { } , { mode = 'production' , configName } ) => {
20+ if ( configName && configName . includes ( name ) ) {
21+ return { name}
22+ }
2023
2124 const isProd = mode === 'production' ;
2225
@@ -25,15 +28,15 @@ module.exports = (env = {}, { mode = 'production' }) => {
2528 const {
2629 targetsBrowsers = 'defaults' ,
2730 noPresetEnv = ! isProd ,
28- noCompress = ! isProd ,
29- vueVersion = '3' ,
31+ noCompress = ! isProd
3032 } = env ;
3133
3234 const genSourcemap = false ;
3335
3436 console . log ( 'config' , { targetsBrowsers, noPresetEnv, noCompress, genSourcemap, vueVersion } ) ;
3537
3638 return {
39+ name,
3740 entry : [
3841 'regenerator-runtime' ,
3942 Path . resolve ( __dirname , '../src/index.ts' ) ,
@@ -156,7 +159,7 @@ ${ pkg.name } v${ pkg.version }
156159@description ${ pkg . description } .
157160@author ${ pkg . author . name } <${ pkg . author . email } >
158161@license ${ pkg . license }
159- ` . trim ( ) ) ,
162+ ` . trim ( ) ) ,
160163 ] ,
161164 resolve : {
162165 extensions : [ ".ts" , ".js" ] ,
@@ -300,3 +303,9 @@ ${ pkg.name } v${ pkg.version }
300303 }
301304}
302305
306+ let configs = [
307+ { name : 'vue2' , vueVersion : '2' } ,
308+ { name : 'vue3' , vueVersion : '3' }
309+ ]
310+
311+ module . exports = configs . map ( configure )
0 commit comments