56 lines
1.2 KiB
JavaScript
56 lines
1.2 KiB
JavaScript
import { defineConfig } from 'vite'
|
|
import { dirname, resolve } from 'node:path'
|
|
import { fileURLToPath } from 'node:url'
|
|
import vue from '@vitejs/plugin-vue'
|
|
|
|
const __dirname = dirname(fileURLToPath(import.meta.url))
|
|
|
|
export default defineConfig({
|
|
plugins: [
|
|
vue(),
|
|
],
|
|
optimizeDeps: {
|
|
include: ['vue']
|
|
},
|
|
build: {
|
|
outDir: '../priv/static',
|
|
emptyOutDir: false,
|
|
rollupOptions: {
|
|
input: {
|
|
main: resolve(__dirname, 'index.html'),
|
|
},
|
|
output: {
|
|
entryFileNames: 'app.js',
|
|
chunkFileNames: 'chunks/[name].js',
|
|
assetFileNames: 'assets/[name].[ext]'
|
|
}
|
|
}
|
|
},
|
|
resolve: {
|
|
alias: {
|
|
"@": fileURLToPath(new URL('./src', import.meta.url)),
|
|
"@stores": fileURLToPath(new URL('./src/stores', import.meta.url)),
|
|
},
|
|
},
|
|
server: {
|
|
proxy: {
|
|
'/tiles': {
|
|
target: 'http://localhost:4000',
|
|
changeOrigin: true,
|
|
secure: false
|
|
},
|
|
'/api': {
|
|
target: 'http://localhost:4000',
|
|
changeOrigin: true,
|
|
secure: false
|
|
},
|
|
'/health': {
|
|
target: 'http://localhost:4000',
|
|
changeOrigin: true,
|
|
secure: false
|
|
},
|
|
}
|
|
}
|
|
})
|
|
|