-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.js
58 lines (48 loc) · 1.45 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
const customWebpack = (config, { buildId, dev, isServer, defaultLoaders, nextRuntime, webpack }) => {
if (isServer && !dev) {
if (Array.isArray(config.optimization.minimizer)) {
const terserIndex = config.optimization.minimizer.findIndex(
(minimizer) => minimizer.constructor.name === 'TerserPlugin'
);
if (terserIndex > -1) {
config.optimization.minimizer[terserIndex].options.terserOptions = {
...config.optimization.minimizer[terserIndex].options.terserOptions,
compress: false,
mangle: false,
};
}
}
}
return config;
};
const withPWA = require("next-pwa")({
pwa: {
dest: "public",
disable: process.env.NODE_ENV === 'development',
},
});
const plugins = []
if (process.env.ANALYZE === 'true') {
// only load dependency if env `ANALYZE` was set
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: true,
})
plugins.push(withBundleAnalyzer)
}
plugins.push(withPWA)
/** @type {import('next').NextConfig} */
const nextConfig = {
swcMinify: false,
reactStrictMode: true,
staticPageGenerationTimeout: 200,
//output: "standalone",
compiler: {
// removeConsole: process.env.NODE_ENV !== 'development',
},
experimental: {
serverComponentsExternalPackages: ["typeorm", "typedi"],//incluir oci-sdk?
serverMinification: false, //typeorm
esmExternals: 'loose', //oci sdk
},
}
module.exports= {...nextConfig,...withPWA}