@@ -16,7 +16,10 @@ const pkg = require('../package.json');
16
16
17
17
const distPath = Path . resolve ( __dirname , '..' , 'dist' ) ;
18
18
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
+ }
20
23
21
24
const isProd = mode === 'production' ;
22
25
@@ -25,15 +28,15 @@ module.exports = (env = {}, { mode = 'production' }) => {
25
28
const {
26
29
targetsBrowsers = 'defaults' ,
27
30
noPresetEnv = ! isProd ,
28
- noCompress = ! isProd ,
29
- vueVersion = '3' ,
31
+ noCompress = ! isProd
30
32
} = env ;
31
33
32
34
const genSourcemap = false ;
33
35
34
36
console . log ( 'config' , { targetsBrowsers, noPresetEnv, noCompress, genSourcemap, vueVersion } ) ;
35
37
36
38
return {
39
+ name,
37
40
entry : [
38
41
'regenerator-runtime' ,
39
42
Path . resolve ( __dirname , '../src/index.ts' ) ,
@@ -156,7 +159,7 @@ ${ pkg.name } v${ pkg.version }
156
159
@description ${ pkg . description } .
157
160
@author ${ pkg . author . name } <${ pkg . author . email } >
158
161
@license ${ pkg . license }
159
- ` . trim ( ) ) ,
162
+ ` . trim ( ) ) ,
160
163
] ,
161
164
resolve : {
162
165
extensions : [ ".ts" , ".js" ] ,
@@ -300,3 +303,9 @@ ${ pkg.name } v${ pkg.version }
300
303
}
301
304
}
302
305
306
+ let configs = [
307
+ { name : 'vue2' , vueVersion : '2' } ,
308
+ { name : 'vue3' , vueVersion : '3' }
309
+ ]
310
+
311
+ module . exports = configs . map ( configure )
0 commit comments