forked from cds-snc/ircc-rescheduler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrazzle.config.js
38 lines (37 loc) · 1.29 KB
/
razzle.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
module.exports = {
modify: (config, { target, dev }, webpack) => {
/* Ignore so we don't include these in the bundle */
config.plugins.push(
new webpack.IgnorePlugin(/^\.\/(?!en)(.+)$/, /validatorjs\/src\/lang/),
)
if (process.env.CI) config.performance = { hints: false }
if (config.devServer) {
config.devServer.host = '0.0.0.0'
}
if (process.env.RAZZLE_STAGE) {
config.devtool = 'source-map'
}
if (process.env.BUNDLE_CHECK) {
/* This allows us to analyze the the webpack bundle of all our apis and imports.
You can change the analyzerMode to be 'server' and this may let you see more info like
what the files looked gzipped,parsed and standard etc.. */
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer')
.BundleAnalyzerPlugin
config.plugins.push(
new BundleAnalyzerPlugin({
analyzerMode: 'static',
generateStatsFile: true,
reportFilename:
target === 'web'
? '../../reports/sourceReport.html'
: '../reports/modulesReport.html',
statsFilename:
target === 'web'
? '../../reports/sourceStats.json'
: '../reports/modulesStats.json',
}),
)
}
return config
},
}