forked from pankod/next-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.js
30 lines (27 loc) · 997 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
/* eslint-disable @typescript-eslint/no-var-requires */
const withPlugins = require('next-compose-plugins');
const withTypescript = require('@zeit/next-typescript');
const withCSS = require('@zeit/next-css');
const withSass = require('@zeit/next-sass');
const withBundleAnalyzer = require('@zeit/next-bundle-analyzer');
const nextRuntimeDotenv = require('next-runtime-dotenv');
/* eslint-enable @typescript-eslint/no-var-requires */
const withConfig = nextRuntimeDotenv({
public: ['API_URL', 'API_KEY'],
});
module.exports = withConfig(
withPlugins([[withTypescript], [withCSS], [withSass], [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',
},
},
}),
);