1
0
mirror of https://github.com/lana-k/sqliteviz.git synced 2025-12-06 10:08:52 +08:00

migrate to vite

This commit is contained in:
lana-k
2025-02-01 20:54:26 +01:00
parent 8fa3c2ae58
commit 828cad6439
17 changed files with 92 additions and 52 deletions

40
vite.config.js Normal file
View File

@@ -0,0 +1,40 @@
import { fileURLToPath, URL } from 'node:url'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { nodePolyfills } from 'vite-plugin-node-polyfills'
import { viteStaticCopy } from 'vite-plugin-static-copy'
// https://vitejs.dev/config/
export default defineConfig({
base: '',
plugins: [
vue(),
nodePolyfills({
include: ['process', 'util', 'stream', 'buffer'],
globals: { global: true, process: true },
}),
viteStaticCopy({
targets: [
{
src: 'LICENSE',
dest: './'
}
]
})
],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
},
extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.vue'],
},
optimizeDeps: {
include:['sql.js/dist/sql-wasm.js'],
esbuildOptions: {
define: {
global: 'globalThis'
}
}
}
})