-
-
Notifications
You must be signed in to change notification settings - Fork 43
/
next.config.js
47 lines (39 loc) · 1.01 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
/** @type {import('next').NextConfig} */
const withPWA = require("next-pwa")({
dest: "public",
disable: process.env.NODE_ENV === "development",
register: true,
runtimeCaching: require("next-pwa/cache"),
buildExcludes: [
/middleware-manifest\.json$/,
/middleware-runtime\.js$/,
/_middleware\.js$/,
/^.+\\_middleware\.js$/,
],
publicExcludes: ["!robots.txt"],
});
const nextConfig = {
reactStrictMode: true,
webpack(config, { isServer }) {
// Handle SVG files
config.module.rules.push({
test: /\.svg$/,
use: ["@svgr/webpack"],
});
// Handle fs fallback for client-side
if (!isServer) {
config.resolve.fallback = {
fs: false,
};
}
return config;
},
images: {
domains: [],
remotePatterns: [],
},
experimental: {},
};
// Load environment variables
require("dotenv").config();
module.exports = withPWA(nextConfig);