@@ -83,7 +83,10 @@ const configure = ({name, vueTarget, libraryTargetModule}) => (env = {}, { mode
83
83
84
84
const genSourcemap = false ;
85
85
86
- console . log ( 'config' , { targetsBrowsers, noPresetEnv, noCompress, noSourceMap, genSourcemap, libraryTargetModule, vueTarget } ) ;
86
+ // excludes cases that make no sense
87
+ const actualTargetsBrowsers = targetsBrowsers + ( libraryTargetModule ? ' and supports es6-module' : '' ) + ( vueTarget == 3 ? ' and supports proxy' : '' ) ;
88
+
89
+ console . log ( 'config' , { actualTargetsBrowsers, noPresetEnv, noCompress, noSourceMap, genSourcemap, libraryTargetModule, vueTarget } ) ;
87
90
88
91
return {
89
92
name,
@@ -113,10 +116,10 @@ const configure = ({name, vueTarget, libraryTargetModule}) => (env = {}, { mode
113
116
environment : {
114
117
// doc: https://webpack.js.org/configuration/output/#outputenvironment
115
118
...! noPresetEnv ? {
116
- arrowFunction : caniuse . isSupported ( 'arrow-functions' , targetsBrowsers ) ,
117
- const : caniuse . isSupported ( 'const' , targetsBrowsers ) ,
118
- destructuring : caniuse . isSupported ( 'es6' , targetsBrowsers ) , // see https://github.com/Fyrd/caniuse/issues/5676
119
- forOf : caniuse . isSupported ( 'es6' , targetsBrowsers ) ,
119
+ arrowFunction : caniuse . isSupported ( 'arrow-functions' , actualTargetsBrowsers ) ,
120
+ const : caniuse . isSupported ( 'const' , actualTargetsBrowsers ) ,
121
+ destructuring : caniuse . isSupported ( 'es6' , actualTargetsBrowsers ) , // see https://github.com/Fyrd/caniuse/issues/5676
122
+ forOf : caniuse . isSupported ( 'es6' , actualTargetsBrowsers ) ,
120
123
} : { } ,
121
124
} ,
122
125
} ,
@@ -186,8 +189,8 @@ const configure = ({name, vueTarget, libraryTargetModule}) => (env = {}, { mode
186
189
passes : 2 ,
187
190
drop_console : true ,
188
191
...! noPresetEnv ? {
189
- arrows : caniuse . isSupported ( 'arrow-functions' , targetsBrowsers ) ,
190
- ecma : caniuse . isSupported ( 'es6' , targetsBrowsers ) ? '2015' : '5' , // note ECMAScript 2015 is the sixth edition of the ECMAScript Language Specification standard
192
+ arrows : caniuse . isSupported ( 'arrow-functions' , actualTargetsBrowsers ) ,
193
+ ecma : caniuse . isSupported ( 'es6' , actualTargetsBrowsers ) ? '2015' : '5' , // note ECMAScript 2015 is the sixth edition of the ECMAScript Language Specification standard
191
194
} : { } ,
192
195
193
196
// beware, unsafe: true is not suitable for this project !
@@ -196,7 +199,7 @@ const configure = ({name, vueTarget, libraryTargetModule}) => (env = {}, { mode
196
199
// unsafe_Function: true,
197
200
// unsafe_math: true,
198
201
// unsafe_symbols: true,
199
- // unsafe_methods: caniuse.isSupported('es6', targetsBrowsers ),
202
+ // unsafe_methods: caniuse.isSupported('es6', actualTargetsBrowsers ),
200
203
// unsafe_proto: true,
201
204
// unsafe_regexp: true,
202
205
// unsafe_undefined: true,
@@ -352,7 +355,7 @@ ${ pkg.name } v${ pkg.version } for vue${ vueTarget }
352
355
compact : ! noCompress ,
353
356
sourceMaps : ! noSourceMap ,
354
357
sourceType : 'unambiguous' , // doc: https://babeljs.io/docs/en/options#sourcetype
355
- targets : targetsBrowsers ,
358
+ targets : actualTargetsBrowsers ,
356
359
presets : [
357
360
358
361
...! noPresetEnv ? [
0 commit comments