-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.ts
More file actions
35 lines (32 loc) · 1.15 KB
/
Copy pathnext.config.ts
File metadata and controls
35 lines (32 loc) · 1.15 KB
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
import type { NextConfig } from "next";
/**
* TypeCraft runs entirely in the browser (projects live in localStorage and
* fonts compile client-side), so the whole app can ship as a static export.
*
* - STATIC_EXPORT=1 build a fully static site into ./out (used by the
* GitHub Pages deploy workflow; `next dev` unaffected).
* - NEXT_PUBLIC_BASE_PATH subdirectory the site is served from, e.g.
* "/TypeCraft" on GitHub Pages project sites. Also
* read by client code that fetches public assets.
*/
const basePath = process.env.NEXT_PUBLIC_BASE_PATH || "";
const nextConfig: NextConfig = {
reactStrictMode: true,
...(process.env.STATIC_EXPORT ? { output: "export" as const, trailingSlash: true } : {}),
...(basePath ? { basePath } : {}),
experimental: {
optimizePackageImports: ["lucide-react"]
},
webpack(config) {
config.experiments = {
...config.experiments,
asyncWebAssembly: true
};
config.module.rules.push({
test: /\.(woff|woff2|wasm)$/i,
type: "asset/resource"
});
return config;
}
};
export default nextConfig;