keanu-weblite/vite.config.mjs

64 lines
1.8 KiB
JavaScript
Raw Normal View History

2025-03-31 16:33:54 +02:00
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue2";
import { fileURLToPath, URL } from "node:url";
import Components from "unplugin-vue-components/vite";
import { viteStaticCopy } from 'vite-plugin-static-copy';
import nodePolyfills from 'rollup-plugin-polyfill-node';
2025-03-31 17:41:21 +02:00
function VuetifyResolver() {
return {
type: 'component',
resolve: (name) => {
if (name.match(/^V[A-Z]/) && !name.includes("VEmojiPicker"))
return { name, from: 'vuetify/lib' }
},
}
}
2025-03-31 16:33:54 +02:00
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
vue(),
Components({
resolvers: [VuetifyResolver()],
}),
viteStaticCopy({
targets: [
{
src: "src/assets/config.json",
dest: ''
},
{
src: "node_modules/@matrix-org/olm/olm.wasm",
dest: ''
},
{
src: 'node_modules/@matrix-org/matrix-sdk-crypto-wasm/pkg/matrix_sdk_crypto_wasm_bg.wasm',
dest: '/node_modules/.vite/deps/pkg'
}
]
}),
nodePolyfills()
],
resolve: {
extensions: [".mjs", ".js", ".ts", ".jsx", ".tsx", ".json", ".vue", ".wasm"],
alias: {
"@": fileURLToPath(new URL("./src", import.meta.url)),
2025-03-31 17:50:47 +02:00
"~@": fileURLToPath(new URL("./src", import.meta.url)),
2025-03-31 16:33:54 +02:00
"~vuetify": fileURLToPath(new URL("./node_modules/vuetify", import.meta.url)),
},
},
define: {
global: "window",
Lame: "window.Lame",
Presets: "window.Presets",
GainAnalysis: "window.GainAnalysis",
QuantizePVT: "window.QuantizePVT",
Quantize: "window.Quantize",
Takehiro: "window.Takehiro",
Reservoir: "window.Reservoir",
MPEGMode: "window.MPEGMode",
BitStream: "window.BitStream",
},
});