@@ -16,7 +16,7 @@ const pkg = require('../package.json');
16
16
17
17
const distPath = Path . resolve ( __dirname , '..' , 'dist' ) ;
18
18
19
- const configure = ( { name, vueVersion } ) => ( env = { } , { mode = 'production' , configName } ) => {
19
+ const configure = ( { name, vueTarget } ) => ( env = { } , { mode = 'production' , configName } ) => {
20
20
if ( configName && ! configName . includes ( name ) ) {
21
21
return { name}
22
22
}
@@ -34,7 +34,7 @@ const configure = ({name, vueVersion}) => (env = {}, { mode = 'production', conf
34
34
35
35
const genSourcemap = false ;
36
36
37
- console . log ( 'config' , { targetsBrowsers, noPresetEnv, noCompress, noSourceMap, genSourcemap, vueVersion } ) ;
37
+ console . log ( 'config' , { targetsBrowsers, noPresetEnv, noCompress, noSourceMap, genSourcemap, vueTarget } ) ;
38
38
39
39
return {
40
40
name,
@@ -45,10 +45,10 @@ const configure = ({name, vueVersion}) => (env = {}, { mode = 'production', conf
45
45
46
46
output : {
47
47
path : distPath ,
48
- filename : `vue${ vueVersion } -sfc-loader.js` ,
48
+ filename : `vue${ vueTarget } -sfc-loader.js` ,
49
49
library : {
50
50
type : 'umd' ,
51
- name : `vue${ vueVersion } -sfc-loader` ,
51
+ name : `vue${ vueTarget } -sfc-loader` ,
52
52
} ,
53
53
environment : {
54
54
// doc: https://webpack.js.org/configuration/output/#outputenvironment
@@ -153,7 +153,7 @@ const configure = ({name, vueVersion}) => (env = {}, { mode = 'production', conf
153
153
// doc: https://github.com/webpack-contrib/webpack-bundle-analyzer#options-for-plugin
154
154
analyzerMode : 'static' ,
155
155
openAnalyzer : false ,
156
- reportFilename : `vue${ vueVersion } -sfc-loader.report.html`
156
+ reportFilename : `vue${ vueTarget } -sfc-loader.report.html`
157
157
} )
158
158
] : [ ] ,
159
159
@@ -170,7 +170,7 @@ ${ pkg.name } v${ pkg.version }
170
170
mainFields : [ 'browser' , 'main' , 'module' ] ,
171
171
alias : {
172
172
173
- './createSFCModule' : `./createVue${ vueVersion } SFCModule` ,
173
+ './createSFCModule' : `./createVue${ vueTarget } SFCModule` ,
174
174
175
175
// dedupe (see DuplicatePackageCheckerPlugin result)
176
176
'bn.js' : require . resolve ( 'bn.js' ) ,
@@ -307,8 +307,8 @@ ${ pkg.name } v${ pkg.version }
307
307
}
308
308
309
309
let configs = [
310
- { name : 'vue2' , vueVersion : '2' } ,
311
- { name : 'vue3' , vueVersion : '3' }
310
+ { name : 'vue2' , vueTarget : '2' } ,
311
+ { name : 'vue3' , vueTarget : '3' }
312
312
]
313
313
314
314
module . exports = configs . map ( configure )
0 commit comments