random-web-tools/vite.config.js

38 lines
668 B
JavaScript

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"),
},
},
css: {
preprocessorOptions: {
scss: {
api: "modern",
importers: [],
},
},
},
server: {
host: true,
port: 3000,
cors: false,
},
preview: {
host: true,
port: 3000,
cors: false,
},
});