random-web-tools/vite.config.js

30 lines
551 B
JavaScript
Raw Normal View History

2024-10-16 11:19:00 +03:00
import { fileURLToPath, URL } from "url";
2023-11-10 16:00:27 +02:00
2024-10-16 11:19:00 +03:00
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
2023-11-10 16:00:27 +02:00
function pathTo(path) {
2024-10-16 11:19:00 +03:00
return fileURLToPath(new URL(path, import.meta.url));
2023-11-10 16:00:27 +02:00
}
// https://vitejs.dev/config/
export default defineConfig({
2024-10-16 11:19:00 +03:00
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,
},
});