chat-with-internet / next.config.js
matt HOFFNER
initial attempt to use vad for detecting end of speech
c8758af
const CopyPlugin = require('copy-webpack-plugin');
/** @type {import('next').NextConfig} */
const nextConfig = {
output: "standalone",
// Custom Webpack configuration
webpack: (config, { buildId, dev, isServer, defaultLoaders, webpack }) => {
// Add the node-loader for handling .node files
config.module.rules.push({
test: /\.node$/,
loader: 'node-loader',
});
// Add CopyPlugin to copy VAD assets
config.plugins.push(
new CopyPlugin({
patterns: [
{
from: "node_modules/@ricky0123/vad-web/dist/vad.worklet.bundle.min.js",
to: "static/chunks/[name][ext]", // Adjusted path
},
{
from: "node_modules/@ricky0123/vad-web/dist/*.onnx",
to: "static/chunks/[name][ext]", // Adjusted path
},
{
from: "node_modules/onnxruntime-web/dist/*.wasm",
to: "static/chunks/[name][ext]" // Adjusted path
},
],
})
);
// Return the modified config
return config;
},
}
module.exports = nextConfig;