-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathnext.config.js
40 lines (37 loc) · 1.24 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
const CopyPlugin = require("copy-webpack-plugin");
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
const nextTranslate = require("next-translate");
module.exports = nextTranslate({
webpack: function (config, { dev, isServer }) {
// Fixes npm packages that depend on `fs` module
if (!isServer) {
config.resolve.fallback.fs = false
}
// copy files you're interested in
if (!dev) {
config.plugins.push(
new CopyPlugin({
patterns: [{ from: "src/assets", to: "assets" }]
})
)
}
if (process.env.ANALYZE) {
config.plugins.push(
new BundleAnalyzerPlugin({
analyzerMode: "server",
analyzerPort: isServer ? 8888 : 8889,
openAnalyzer: true
})
);
}
return config
},
output: "standalone",
staticPageGenerationTimeout: 60*4,
eslint: {
ignoreDuringBuilds: process.env.IGNORE_LINT && process.env.IGNORE_LINT === "true"
},
typescript: {
ignoreBuildErrors: process.env.IGNORE_TYPE_ERRORS && process.env.IGNORE_TYPE_ERRORS === "true"
}
});