@@ -31,7 +31,7 @@ module.exports = (options = {}) => {
3131 type : 'window' ,
3232 }
3333 } ,
34- devtool : ' source-map',
34+ devtool : mode === 'development' ? ' source-map' : false ,
3535 externals : {
3636 react : 'React' ,
3737 'react-dom' : 'ReactDOM' ,
@@ -53,31 +53,31 @@ module.exports = (options = {}) => {
5353 test : / \. t s ( x ? ) $ / ,
5454 include : / n o d e _ m o d u l e s [ \\ \/ ] ( h i g h l i g h t [ . ] j s | d 3 - f o r m a t ) [ \\ \/ ] / ,
5555 use : [
56- { loader : 'babel-loader' , options : babel } ,
57- { loader : 'ts-loader' , options : ts } ,
56+ { loader : 'babel-loader' , options : { ... babel , cacheDirectory : true } } ,
57+ { loader : 'ts-loader' , options : { ... ts , transpileOnly : true } } ,
5858 ]
5959 } ,
6060 {
6161 test : / \. t s ( x ? ) $ / ,
6262 exclude : / n o d e _ m o d u l e s / ,
6363 use : [
64- { loader : 'babel-loader' , options : babel } ,
65- { loader : 'ts-loader' , options : ts } ,
64+ { loader : 'babel-loader' , options : { ... babel , cacheDirectory : true } } ,
65+ { loader : 'ts-loader' , options : { ... ts , transpileOnly : true } } ,
6666 { loader : 'webpack-preprocessor' , options : JSON . stringify ( preprocessor ) }
6767 ]
6868 } ,
6969 {
7070 test : / \. j s $ / ,
7171 include : / n o d e _ m o d u l e s [ \\ \/ ] ( h i g h l i g h t [ . ] j s | d 3 - f o r m a t ) [ \\ \/ ] / ,
7272 use : [
73- { loader : 'babel-loader' , options : babel }
73+ { loader : 'babel-loader' , options : { ... babel , cacheDirectory : true } }
7474 ]
7575 } ,
7676 {
7777 test : / \. j s $ / ,
7878 exclude : / n o d e _ m o d u l e s / ,
7979 use : [
80- { loader : 'babel-loader' , options : babel } ,
80+ { loader : 'babel-loader' , options : { ... babel , cacheDirectory : true } } ,
8181 { loader : 'webpack-preprocessor' , options : JSON . stringify ( preprocessor ) }
8282 ]
8383 } ,
@@ -98,6 +98,12 @@ module.exports = (options = {}) => {
9898 }
9999 ]
100100 } ,
101+ cache : {
102+ type : 'filesystem' ,
103+ buildDependencies : {
104+ config : [ __filename ]
105+ }
106+ } ,
101107 resolve : {
102108 alias : {
103109 'dash-table' : path . resolve ( './src/dash-table' ) ,
0 commit comments