Use vite as bundler
This commit is contained in:
parent
16dc5df9e5
commit
b6f7f75fdd
44 changed files with 4308 additions and 15961 deletions
53
vite.config.mjs
Normal file
53
vite.config.mjs
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
import { defineConfig } from "vite";
|
||||
import vue from "@vitejs/plugin-vue2";
|
||||
import { fileURLToPath, URL } from "node:url";
|
||||
import Components from "unplugin-vue-components/vite";
|
||||
import { VuetifyResolver } from "unplugin-vue-components/resolvers";
|
||||
import { viteStaticCopy } from 'vite-plugin-static-copy';
|
||||
import nodePolyfills from 'rollup-plugin-polyfill-node';
|
||||
|
||||
// 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)),
|
||||
"~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",
|
||||
},
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue