-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.js
55 lines (48 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/** @type {import('next').NextConfig} */
const nextConfig = {
// Other configuration options
// server: {
// host: "0.0.0.0",
// },
typescript: {
// !! WARN !!
// Dangerously allow production builds to successfully complete even if
// your project has type errors.
// !! WARN !!
ignoreBuildErrors: true,
},
reactStrictMode: true,
};
const withPWA = require("@ducanh2912/next-pwa").default({
dest: "public",
disableDevLogs: true,
fallbacks: {
// Failed page requests fallback to this.
document: "/~offline",
},
// importScripts: ["firebase-messaging-sw.js"],
// disable: process.env.NODE_ENV === "development",
// register: true,
// scope: "/app",
// sw: "service-worker.js",
//...
});
module.exports = withPWA({
...nextConfig,
webpack: (config, { isServer }) => {
config.resolve.fallback = {
// if you miss it, all the other options in fallback, specified
// by next.js will be dropped.
...config.resolve.fallback,
fs: false, // the solution
};
if (!isServer) {
config.externals.push({
bufferutil: "bufferutil",
"utf-8-validate": "utf-8-validate",
"supports-color": "supports-color",
});
}
return config;
},
});