@@ -6,8 +6,7 @@ const productName = 'iclient-maplibregl';
66
77module . exports = {
88 target : configBase . target ,
9- mode : 'development' || configBase . mode ,
10- devtool : 'inline-cheap-module-source-map' ,
9+ mode : configBase . mode ,
1110 //页面入口文件配置
1211 entry : configBase . entry ,
1312 //入口文件输出配置
@@ -21,8 +20,14 @@ module.exports = {
2120
2221 externals : Object . assign ( { } , configBase . externals , {
2322 'maplibre-gl' : 'maplibregl' ,
24- three : 'THREE' ,
25- 'webgl-debug' : '(function(){try{return webgl-debug}catch(e){return {}}})()'
23+ three : 'function(){try{return THREE}catch(e){return {}}}()' ,
24+ 'deck.gl' : '(function(){try{return DeckGL}catch(e){return {}}})()' ,
25+ 'webgl-debug' : '(function(){try{return webgl-debug}catch(e){return {}}})()' ,
26+ 'luma.gl' : '(function(){try{return luma}catch(e){return {}}})()' ,
27+ xlsx : 'function(){try{return XLSX}catch(e){return {}}}()' ,
28+ canvg : 'function(){try{return canvg}catch(e){return {}}}()' ,
29+ jsonsql : 'function(){try{return jsonsql}catch(e){return {}}}()' ,
30+ 'xml-js' : 'function(){try{return convert}catch(e){return {}}}()'
2631 } ) ,
2732
2833 module : {
@@ -32,7 +37,7 @@ module.exports = {
3237 moduleRules . push ( configBase . module . rules . img ) ;
3338 const babelConfig = {
3439 test : [ / \. j s $ / ] ,
35- include : / n o d e _ m o d u l e s [ \/ \\ ] ( p r o j 4 | m a p l i b r e - g l ) / ,
40+ exclude : / n o d e _ m o d u l e s [ \/ \\ ] p r o j 4 | c l a s s i c | w e b g l - d e b u g / ,
3641 loader : 'babel-loader' ,
3742 options : {
3843 presets : [ '@babel/preset-env' ] ,
@@ -46,12 +51,11 @@ module.exports = {
4651 regenerator : true ,
4752 useESModules : false
4853 }
49- ] ,
50- '@babel/plugin-proposal-nullish-coalescing-operator'
54+ ]
5155 ]
5256 }
5357 } ;
54- configBase . moduleVersion === 'es6' ;
58+ configBase . moduleVersion === 'es6' && ( babelConfig . include = / F G B L a y e r | f l a t g e o b u f / ) ;
5559 moduleRules . push ( babelConfig ) ;
5660 moduleRules . push ( configBase . module . rules . css ) ;
5761 return moduleRules ;
0 commit comments