-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnext.config.js
45 lines (39 loc) · 1 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
const withBundleAnalyzer = require("@next/bundle-analyzer")({
enabled: process.env.ANALYZE === "true",
});
const withPWA = require("next-pwa")({
dest: "public",
disable: process.env.NODE_ENV === "development",
});
/** @type {import('next').NextConfig} */
const nextConfig = {
eslint: {
ignoreDuringBuilds: true,
},
experimental: {
appDir: true,
scrollRestoration: true,
},
images: {
unoptimized: true,
},
reactStrictMode: false,
sassOptions: {
additionalData: async (content, { resourcePath }) => {
if (resourcePath.includes("node_modules")) {
return content;
}
if (resourcePath.endsWith("mq-settings.scss")) {
return process.env.NODE_ENV === "production" ? "" : content;
}
return "@use '@/styles/mq' as mq;" + content;
},
},
};
module.exports = (_, { defaultConfig }) => {
const plugins = [withPWA, withBundleAnalyzer];
return plugins.reduce((acc, next) => next(acc), {
...defaultConfig,
...nextConfig,
});
};