-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.ts
More file actions
28 lines (25 loc) · 762 Bytes
/
next.config.ts
File metadata and controls
28 lines (25 loc) · 762 Bytes
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
import type { NextConfig } from "next";
import withSerwistInit from "@serwist/next";
const withSerwist = withSerwistInit({
swSrc: "app/sw.ts",
swDest: "public/sw.js",
disable: process.env.NODE_ENV === "development",
});
const nextConfig: NextConfig = {
reactStrictMode: true,
// Build output outside mounted FUSE filesystem to avoid permission issues
distDir: process.env.NEXT_DIST_DIR ?? ".next",
// Empty turbopack config signals we're turbopack-aware
turbopack: {},
// pdfjs-dist needs canvas stub in browser
webpack: (config, { isServer }) => {
if (!isServer) {
config.resolve.alias = {
...config.resolve.alias,
canvas: false,
};
}
return config;
},
};
export default withSerwist(nextConfig);