/
next.config.js
30 lines (29 loc) · 984 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
const withBundleAnalyzer = require("@zeit/next-bundle-analyzer");
const withCSS = require('@zeit/next-css');
const withOffline = require('next-offline');
const withPlugins = require("next-compose-plugins");
const path = require('path');
module.exports = withPlugins([
[withCSS],
[withBundleAnalyzer, {
analyzeServer: ["server", "both"].includes(process.env.BUNDLE_ANALYZE),
analyzeBrowser: ["browser", "both"].includes(process.env.BUNDLE_ANALYZE),
bundleAnalyzerConfig: {
server: {
analyzerMode: 'static',
reportFilename: '../bundles/server.html'
},
browser: {
analyzerMode: 'static',
reportFilename: '../bundles/client.html'
}
}
}],
[withOffline, {
generateSw: false,
workboxOpts: {
swSrc: path.join(__dirname, 'service-worker.js'),
importWorkboxFrom: 'local'
}
}],
]);