-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathnext.config.mjs
55 lines (50 loc) · 1.46 KB
/
next.config.mjs
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 basePath = process.env.NEXT_PUBLIC_BASE_PATH || "";
import withSerwistInit from '@serwist/next';
import { nanoid } from 'nanoid';
const revision = nanoid();
const withSerwist = withSerwistInit({
swSrc: 'app/sw.ts',
swDest: 'public/sw.js',
additionalPrecacheEntries: [
{ url: "404.html", revision: revision },
{ url: "files.html", revision: revision },
{ url: "files.txt", revision: revision },
{ url: "home.html", revision: revision },
{ url: "home.txt", revision: revision },
{ url: "index.html", revision: revision },
{ url: "index.txt", revision: revision },
{ url: "redirect.html", revision: revision },
{ url: "redirect.txt", revision: revision },
{ url: "settings.html", revision: revision },
{ url: "settings.txt", revision: revision },
{ url: "albums.html", revision: revision },
{ url: "albums.txt", revision: revision },
],
reloadOnOnline: false,
register: false,
});
export default withSerwist({
basePath: basePath,
reactStrictMode: true,
output: "export",
transpilePackages: ['three'],
env: {
APP_VERSION: process.env.npm_package_version
},
compiler: {
emotion: true
},
webpack: (config, { isServer }) => {
if (!isServer) {
config.optimization.splitChunks = {
// Reduce a lot of js chunks.
cacheGroups: {
default: false,
vendors: false,
},
};
}
return config;
},
});