Skip to content

Commit 1f4337a

Browse files
authored
Merge pull request #3367 from plotly/buildtimes
Improved dash-table build time
2 parents 62db98a + 1215e18 commit 1f4337a

File tree

3 files changed

+7360
-45612
lines changed

3 files changed

+7360
-45612
lines changed

components/dash-table/.config/webpack/base.js

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -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: /\.ts(x?)$/,
5454
include: /node_modules[\\\/](highlight[.]js|d3-format)[\\\/]/,
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: /\.ts(x?)$/,
6262
exclude: /node_modules/,
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: /\.js$/,
7171
include: /node_modules[\\\/](highlight[.]js|d3-format)[\\\/]/,
7272
use: [
73-
{ loader: 'babel-loader', options: babel }
73+
{ loader: 'babel-loader', options: { ...babel, cacheDirectory: true } }
7474
]
7575
},
7676
{
7777
test: /\.js$/,
7878
exclude: /node_modules/,
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

Comments
 (0)