@@ -31,7 +31,7 @@ module.exports = (options = {}) => {
31
31
type : 'window' ,
32
32
}
33
33
} ,
34
- devtool : ' source-map',
34
+ devtool : mode === 'development' ? ' source-map' : false ,
35
35
externals : {
36
36
react : 'React' ,
37
37
'react-dom' : 'ReactDOM' ,
@@ -53,31 +53,31 @@ module.exports = (options = {}) => {
53
53
test : / \. t s ( x ? ) $ / ,
54
54
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 ) [ \\ \/ ] / ,
55
55
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 } } ,
58
58
]
59
59
} ,
60
60
{
61
61
test : / \. t s ( x ? ) $ / ,
62
62
exclude : / n o d e _ m o d u l e s / ,
63
63
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 } } ,
66
66
{ loader : 'webpack-preprocessor' , options : JSON . stringify ( preprocessor ) }
67
67
]
68
68
} ,
69
69
{
70
70
test : / \. j s $ / ,
71
71
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 ) [ \\ \/ ] / ,
72
72
use : [
73
- { loader : 'babel-loader' , options : babel }
73
+ { loader : 'babel-loader' , options : { ... babel , cacheDirectory : true } }
74
74
]
75
75
} ,
76
76
{
77
77
test : / \. j s $ / ,
78
78
exclude : / n o d e _ m o d u l e s / ,
79
79
use : [
80
- { loader : 'babel-loader' , options : babel } ,
80
+ { loader : 'babel-loader' , options : { ... babel , cacheDirectory : true } } ,
81
81
{ loader : 'webpack-preprocessor' , options : JSON . stringify ( preprocessor ) }
82
82
]
83
83
} ,
@@ -98,6 +98,12 @@ module.exports = (options = {}) => {
98
98
}
99
99
]
100
100
} ,
101
+ cache : {
102
+ type : 'filesystem' ,
103
+ buildDependencies : {
104
+ config : [ __filename ]
105
+ }
106
+ } ,
101
107
resolve : {
102
108
alias : {
103
109
'dash-table' : path . resolve ( './src/dash-table' ) ,
0 commit comments