-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.mjs
60 lines (52 loc) · 1.49 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
56
57
58
59
60
import CopyPlugin from "copy-webpack-plugin";
const wasmPaths = [
"./node_modules/onnxruntime-web/dist/ort-wasm.wasm",
"./node_modules/onnxruntime-web/dist/ort-wasm-threaded.wasm",
"./node_modules/onnxruntime-web/dist/ort-wasm-simd.wasm",
"./node_modules/onnxruntime-web/dist/ort-wasm-simd.jsep.wasm",
"./node_modules/onnxruntime-web/dist/ort-wasm-simd-threaded.wasm",
"./node_modules/onnxruntime-web/dist/ort-wasm-simd-threaded.jsep.wasm",
"./node_modules/onnxruntime-web/dist/ort-training-wasm-simd.wasm",
];
const vadModelFiles = [
"./node_modules/@ricky0123/vad-web/dist/vad.worklet.bundle.min.js",
"./node_modules/@ricky0123/vad-web/dist/silero_vad.onnx",
];
const nextConfig = {
images: {
remotePatterns: [
{
protocol: "http",
hostname: "localhost",
},
{
protocol: "https",
hostname: "lh3.googleusercontent.com",
},
],
},
webpack: (config, {}) => {
config.resolve.extensions.push(".ts", ".tsx");
config.resolve.fallback = { fs: false };
config.module.rules.push({
test: /face-api.esm.js/,
type: "javascript/esm",
});
config.plugins.push(
new CopyPlugin({
patterns: [
...wasmPaths.map((path) => ({
from: path,
to: "static/chunks",
})),
...vadModelFiles.map((path) => ({
from: path,
to: "static/chunks",
})),
],
})
);
return config;
},
};
export default nextConfig;