kamilcraft.com/vite.config.js

32 lines
728 B
JavaScript

import { fileURLToPath, URL } from 'node:url';
import { defineConfig, loadEnv, splitVendorChunkPlugin } from 'vite';
import vue from '@vitejs/plugin-vue';
import eslint from 'vite-plugin-eslint';
export default defineConfig((mode) => {
const env = loadEnv(mode, process.cwd(), "");
return {
server: {
host: 'localhost',
port: parseInt(env.VITE_PORT ?? 5173),
hmr: {
host: 'localhost',
},
},
plugins: [
vue(),
splitVendorChunkPlugin(),
eslint(),
],
resolve: {
vue: 'vue/dist/vue.esm-bundler.js',
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
},
},
build: {
manifest: true,
},
};
});