11var path = require ( 'path' )
22var srcPath = path . join ( __dirname , '/../src/' )
3+ var baseConfig = require ( './base' )
34
45module . exports = {
56 devtool : 'eval' ,
@@ -13,22 +14,23 @@ module.exports = {
1314 } ,
1415 {
1516 include : [
16- path . join ( __dirname , '/ ../src' ) ,
17- path . join ( __dirname , '/ ../test' ) ,
17+ path . join ( __dirname , '../src' ) ,
18+ path . join ( __dirname , '../test' ) ,
1819 ] ,
19- test : / \. ( j s | j s x ) $ / ,
20- use : 'babel-loader' ,
20+ test : / \. [ j t ] s x ? $ / ,
21+ use : {
22+ loader : 'babel-loader' ,
23+ options : {
24+ plugins : [
25+ '@babel/plugin-syntax-dynamic-import' ,
26+ [ '@babel/plugin-proposal-class-properties' , { loose : false } ] ,
27+ [ '@babel/plugin-proposal-optional-chaining' , { loose : false } ] ,
28+ ] ,
29+ presets : [ [ '@babel/env' , { modules : false } ] , '@babel/react' , '@babel/typescript' ] ,
30+ } ,
31+ } ,
2132 } ,
2233 ] ,
2334 } ,
24- resolve : {
25- alias : {
26- components : srcPath + 'components/' ,
27- config : srcPath + 'config/' + process . env . REACT_WEBPACK_ENV ,
28- images : srcPath + 'images/' ,
29- store : srcPath + 'store/' ,
30- styles : srcPath + 'styles/' ,
31- } ,
32- extensions : [ '.js' , '.jsx' , '_pb.js' ] ,
33- } ,
35+ resolve : baseConfig . resolve ,
3436}
0 commit comments