forked from dddwa/dddperth-website
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.js
43 lines (40 loc) · 1.09 KB
/
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
34
35
36
37
38
39
40
41
42
43
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;
},
exportPathMap: function () {
return {
'/': {
page: '/'
}
}
},
poweredByHeader: false,
typescriptLoaderOptions: {
transpileOnly: false
}
})
)
)