forked from sozialhelden/wheelmap-frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.js
61 lines (56 loc) · 1.92 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
//const ElasticAPMSourceMapPlugin = require('@hypo808/elastic-apm-sourcemap-webpack-plugin');
//const TTagPlugin = require('babel-plugin-ttag');
const withTranspileModules = require('next-transpile-modules');
//const webpack = require('webpack');
//const env = require('./src/lib/env');
const withSourceMaps = require('@zeit/next-source-maps');
let configuration = withSourceMaps(
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',
'elastic-apm-node': 'empty',
};
// if (process.env.NODE_ENV === 'production') {
// config.plugins.unshift(new ElasticAPMSourceMapPlugin({
// serviceName: 'wheelmap-react-frontend',
// serviceVersion: env.npm_package_version,
// serverURL: env.REACT_APP_ELASTIC_APM_SERVER_URL,
// publicPath: `${env.PUBLIC_URL}/_next/static/chunks`,
// secret: env.ELASTIC_APM_SECRET_TOKEN,
// logLevel: 'debug'
// }));
// }
return config;
},
})
);
// these options would be ignored above, so they needs to be extended manually
configuration = {
...configuration,
typescript: {
// !! WARN !!
// Dangerously allow production builds to successfully complete even if
// your project has type errors.
// !! WARN !!
ignoreBuildErrors: true,
ignoreDevErrors: true,
},
// Disabling file-system routing to always use custom server.
// useFileSystemPublicRoutes: false,
};
module.exports = configuration;