-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.js
37 lines (32 loc) · 1018 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
const nextTranspileModules = require('next-transpile-modules');
const bundleAnalyzer = require('@next/bundle-analyzer');
const nextConfig = {
distDir: 'build',
publicRuntimeConfig: {
localeSubpaths: typeof process.env.LOCALE_SUBPATHS === 'string' ? process.env.LOCALE_SUBPATHS : 'all',
STARTED_AT: process.env.STARTED_AT,
},
env: {
// WARNING: ALL THESE VALUES ARE EXPOSED TO THE CLIENT
// DO NOT PUT ANY SECRETS HERE
// NODE_ENV is handled automatically
BUILT_AT: process.env.BUILT_AT,
PORT: process.env.PORT,
PROJECT_UNDER_TEST: process.env.PROJECT_UNDER_TEST,
HOST: process.env.HOST,
},
compiler: {
// Enables the styled-components SWC transform
styledComponents: true,
},
};
const withTM = nextTranspileModules(['@george-gillams/components']);
const withBundleAnalyzer = bundleAnalyzer({
enabled: process.env.ANALYZE === 'true',
});
module.exports = withBundleAnalyzer({});
module.exports = withBundleAnalyzer(
withTM({
...nextConfig,
})
);