-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.js
35 lines (32 loc) · 933 Bytes
/
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
/** @type {import('next').NextConfig} */
const runtimeCaching = require("next-pwa/cache");
const withPWA = require("next-pwa")({
dest: "public",
register: true,
skipWaiting: true,
customWorkerDir: "worker",
runtimeCaching,
});
const nextConfig = withPWA({
reactStrictMode: false,
});
const withBundleAnalyzer = require("@next/bundle-analyzer")({
enabled: process.env.ANALYZE === "true",
});
module.exports = withBundleAnalyzer({
...nextConfig,
env: {
NEXT_PUBLIC_VAPID_PUBLIC_KEY: process.env.NEXT_PUBLIC_VAPID_PUBLIC_KEY,
},
compress: true,
webpack(config, { webpack }) {
const prod = process.env.NODE_ENV === "production";
const plugins = [...config.plugins];
return {
...config,
mode: prod ? "production" : "development",
devtool: prod ? "hidden-source-map" : "eval",
plugins,
};
},
});