generated from template/astro-simple-template
test
This commit is contained in:
@@ -5,7 +5,7 @@ import sitemap from '@astrojs/sitemap';
|
||||
import pkgs from './package.json';
|
||||
import tailwindcss from '@tailwindcss/vite';
|
||||
const isDev = process.env.NODE_ENV === 'development';
|
||||
|
||||
import { viteStaticCopy } from 'vite-plugin-static-copy';
|
||||
let target = process.env.VITE_API_URL || 'https://localhost:51015';
|
||||
const apiProxy = { target: target, changeOrigin: true, ws: true, rewriteWsOrigin: true, secure: false, cookieDomainRewrite: 'localhost' };
|
||||
let proxy = {
|
||||
@@ -16,6 +16,30 @@ let proxy = {
|
||||
};
|
||||
|
||||
const basename = isDev ? undefined : `${pkgs.basename}`;
|
||||
const vad = viteStaticCopy({
|
||||
targets: [
|
||||
{
|
||||
src: 'node_modules/@ricky0123/vad-web/dist/vad.worklet.bundle.min.js',
|
||||
dest: './public/',
|
||||
},
|
||||
{
|
||||
src: 'node_modules/@ricky0123/vad-web/dist/silero_vad_v5.onnx',
|
||||
dest: './public/',
|
||||
},
|
||||
{
|
||||
src: 'node_modules/@ricky0123/vad-web/dist/silero_vad_legacy.onnx',
|
||||
dest: './public/',
|
||||
},
|
||||
{
|
||||
src: 'node_modules/onnxruntime-web/dist/*.wasm',
|
||||
dest: './public/',
|
||||
},
|
||||
{
|
||||
src: 'node_modules/onnxruntime-web/dist/*.mjs',
|
||||
dest: './public/',
|
||||
},
|
||||
],
|
||||
});
|
||||
export default defineConfig({
|
||||
base: basename,
|
||||
integrations: [
|
||||
@@ -23,14 +47,13 @@ export default defineConfig({
|
||||
react(), //
|
||||
// sitemap(), // sitemap must be site has a domain
|
||||
],
|
||||
|
||||
|
||||
vite: {
|
||||
plugins: [tailwindcss()],
|
||||
plugins: [tailwindcss(), vad],
|
||||
define: {
|
||||
basename: JSON.stringify(basename || ''),
|
||||
},
|
||||
server: {
|
||||
https: true,
|
||||
port: 7008,
|
||||
host: '0.0.0.0',
|
||||
allowedHosts: true,
|
||||
|
||||
Reference in New Issue
Block a user