49 lines
1.5 KiB
JavaScript
49 lines
1.5 KiB
JavaScript
import { defineConfig } from 'vite'
|
|
import vue from '@vitejs/plugin-vue'
|
|
import { fileURLToPath, URL } from 'node:url'
|
|
|
|
// https://vitejs.dev/config/
|
|
export default defineConfig({
|
|
plugins: [vue()],
|
|
server: {
|
|
// The dev server must be reachable from the browser on the host.
|
|
host: 'localhost',
|
|
port: 5173,
|
|
strictPort: true,
|
|
// Since Vite 5.4.12 (CVE-2025-24010) CORS is disabled by default.
|
|
// Explicitly allow the origin(s) that serve the Drupal pages (vhost).
|
|
cors: {
|
|
origin: [/^https?:\/\/dev\.leshed\.fr(:\d+)?$/],
|
|
},
|
|
// Absolute base URL used by Vite to build asset/HMR URLs.
|
|
origin: 'http://localhost:5173',
|
|
hmr: {
|
|
host: 'localhost',
|
|
},
|
|
watch: {
|
|
usePolling: true,
|
|
},
|
|
},
|
|
build: {
|
|
outDir: 'assets/dist',
|
|
rollupOptions: {
|
|
input: 'assets/js/main.js',
|
|
output: {
|
|
entryFileNames: 'main.js',
|
|
assetFileNames: 'main.css'
|
|
}
|
|
}
|
|
},
|
|
resolve: {
|
|
alias: {
|
|
'@api': fileURLToPath(new URL('api', import.meta.url)),
|
|
// '@': fileURLToPath(new URL('./src', import.meta.url)),
|
|
// '@stores': fileURLToPath(new URL('./src/stores', import.meta.url)),
|
|
// '@components': fileURLToPath(new URL('./src/components', import.meta.url)),
|
|
// '@views': fileURLToPath(new URL('./src/views', import.meta.url)),
|
|
// // '@icons': fileURLToPath(new URL('./node_modules/vue-material-design-icons', import.meta.url)),
|
|
// '@node_modules': fileURLToPath(new URL('./node_modules', import.meta.url))
|
|
}
|
|
}
|
|
})
|