-
Notifications
You must be signed in to change notification settings - Fork 1
/
next.config.ts
45 lines (42 loc) · 1.53 KB
/
next.config.ts
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
import type { NextConfig } from "next";
import CopyPlugin from "copy-webpack-plugin";
import path from "path";
const nextConfig: NextConfig = {
webpack: (config) => {
config.plugins.push(
new CopyPlugin({
patterns: [
// error is triggered during the build if the file is not there (but not actually used from here)
{
from: "node_modules/@subzerocloud/rest/subzero_wasm_bg.wasm",
to: "server/app/api/[...query]/subzero_wasm_bg.wasm",
},
// this is used on runtime
{
from: "node_modules/@subzerocloud/rest/subzero_wasm_bg.wasm",
to: "server/vendor-chunks/subzero_wasm_bg.wasm",
},
// error is triggered during the build if the file is not there (but not actually used from here)
{
from: "node_modules/@subzerocloud/rest/subzero_wasm_bg.wasm",
to: "server/src/app/api/[...query]/subzero_wasm_bg.wasm",
},
{
from: "node_modules/@subzerocloud/rest/subzero_wasm_bg.wasm",
to: ".next/server/chunks/subzero_wasm_bg.wasm",
},
],
})
);
return config;
},
outputFileTracingRoot: path.join(__dirname),
outputFileTracingIncludes: {
"/api/**/*": ["./node_modules/**/*.wasm"],
"/src/api/**/*": ["./node_modules/**/*.wasm"],
"/src/app/api/**/*": ["./node_modules/**/*.wasm"],
"/app/api/**/*": ["./node_modules/**/*.wasm"],
},
serverExternalPackages: ["@subzerocloud/rest"],
};
export default nextConfig;