forked from dddwa/dddperth-website
-
Notifications
You must be signed in to change notification settings - Fork 2
/
next.config.js
33 lines (30 loc) · 924 Bytes
/
next.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
const withBundleAnalyzer = require('@zeit/next-bundle-analyzer')
const {
BundleAnalyzerPlugin
} = require('webpack-bundle-analyzer')
const withTypescript = require('@zeit/next-typescript')
const withSass = require('@zeit/next-sass')
module.exports = withSass(
withTypescript(
withBundleAnalyzer({
analyzeServer: ['server', 'both'].includes(process.env.BUNDLE_ANALYZE),
analyzeBrowser: ['browser', 'both'].includes(process.env.BUNDLE_ANALYZE),
webpack: (config, {
dev
}) => {
if (!dev) {
const originalEntry = config.entry;
config.entry = async () => {
const entries = await originalEntry();
if (entries['main.js']) {
entries['main.js'].unshift('./static/scripts/es6-shim.js');
}
return entries;
};
}
return config;
},
poweredByHeader: false
})
)
)