-
Notifications
You must be signed in to change notification settings - Fork 12
/
next.config.js
45 lines (41 loc) · 1.26 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
44
45
const withTranspileModules = require('next-transpile-modules');
//const webpack = require('webpack');
const { loadGlobalEnvironment } = require('@sozialhelden/twelve-factor-dotenv');
const env = loadGlobalEnvironment();
let configuration = withTranspileModules({
// Next.js doesn't transpile node_modules content by default.
// We have to do this manually to make IE 11 users happy.
transpileModules: [
'@sozialhelden/twelve-factor-dotenv',
'@elastic/apm-rum-core',
'@elastic/apm-rum',
'dotenv',
],
webpack: config => {
// Fixes npm packages that depend on `fs` module
config.node = {
fs: 'empty',
dgram: 'empty',
net: 'empty',
tls: 'empty',
child_process: 'empty',
async_hooks: 'mock',
};
return config;
},
});
// these options would be ignored above, so they needs to be extended manually
configuration = {
...configuration,
productionBrowserSourceMaps: false,
typescript: {
// !! WARN !!
// Dangerously allow production builds to successfully complete even if
// your project has type errors.
// !! WARN !!
ignoreBuildErrors: false,
},
// Disabling file-system routing to always use custom server.
// useFileSystemPublicRoutes: false,
};
module.exports = configuration;