random-web-tools/vite.config.js

30 lines
511 B
JavaScript
Raw Normal View History

2023-11-10 16:00:27 +02:00
import {fileURLToPath, URL} from 'url'
import {defineConfig} from 'vite'
import vue from '@vitejs/plugin-vue'
function pathTo(path) {
return fileURLToPath(new URL(path, import.meta.url));
}
// https://vitejs.dev/config/
export default defineConfig({
plugins: [vue()],
resolve: {
alias: {
'@': pathTo('./src', import.meta.url),
'@node_modules': pathTo('./node_modules'),
}
},
server: {
host: true,
port: 3000,
cors: false,
},
preview: {
host: true,
port: 3000,
cors: false,
}
})