forked from demokratie-live/bundestag.io-admin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.js
38 lines (33 loc) · 990 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
34
35
36
37
38
/* eslint-disable */
const { BundleAnalyzerPlugin } = require("webpack-bundle-analyzer");
const { ANALYZE, BUNDESTAGIO_SERVER_URL_CLIENT } = process.env;
const withCss = require("@zeit/next-css");
const withSourceMaps = require("@zeit/next-source-maps");
// fix: prevents error when .css files are required by node
if (typeof require !== "undefined") {
require.extensions[".css"] = file => {};
}
module.exports = withSourceMaps(
withCss({
webpack: function(config) {
if (ANALYZE) {
config.plugins.push(
new BundleAnalyzerPlugin({
analyzerMode: "server",
analyzerPort: 8888,
openAnalyzer: true
})
);
}
return config;
},
serverRuntimeConfig: {
// Will only be available on the server side
mySecret: "secret"
},
publicRuntimeConfig: {
// Will be available on both server and client
BUNDESTAGIO_SERVER_URL: BUNDESTAGIO_SERVER_URL_CLIENT
}
})
);