-
Notifications
You must be signed in to change notification settings - Fork 1
/
next.config.js
55 lines (45 loc) · 1.22 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
await import("./src/lib/env/index.js");
/** @type {import('next').NextConfig} */
const config = {
reactStrictMode: true,
swcMinify: true,
eslint: {
ignoreDuringBuilds: true,
},
typescript: {
ignoreBuildErrors: true,
},
webpack: (config) => {
config.resolve.fallback = { fs: false };
return config;
},
};
/**
* @param {string} phase
* @param {{ defaultConfig: import('next').NextConfig }} options
*/
const nextConfigWithPlugins = async () => {
/* Dynamically import plugins from devDependencies to reduce bundle size */
const withNextIntl = (await import("next-intl/plugin")).default(
"./src/lib/i18n",
);
// const million = await import("million/compiler");
if (process.env.NODE_ENV !== "production") {
return withNextIntl(config);
// return million.next(withNextIntl(config), {
// auto: true,
// rsc: true,
// });
}
const withPWA = (await import("@ducanh2912/next-pwa")).default({
dest: "public",
cacheOnFrontEndNav: true,
aggressiveFrontEndNavCaching: true,
});
return withPWA(withNextIntl(config));
// return million.next(withPWA(withNextIntl(config)), {
// auto: true,
// rsc: true,
// });
};
export default nextConfigWithPlugins;