- update vite config
This commit is contained in:
parent
59cb26ea40
commit
01f28b860d
@ -1,25 +1,15 @@
|
|||||||
import { defineConfig, loadEnv, splitVendorChunkPlugin } from 'vite';
|
import { defineConfig, loadEnv, splitVendorChunkPlugin } from 'vite';
|
||||||
import vue from '@vitejs/plugin-vue';
|
import vue from '@vitejs/plugin-vue';
|
||||||
import { networkInterfaces } from 'os';
|
|
||||||
|
|
||||||
// https://vitejs.dev/config/
|
|
||||||
export default defineConfig((mode) => {
|
export default defineConfig((mode) => {
|
||||||
const env = loadEnv(mode, process.cwd(), "");
|
const env = loadEnv(mode, process.cwd(), "");
|
||||||
return {
|
return {
|
||||||
server: {
|
server: {
|
||||||
//host: Object.values(networkInterfaces()).flat().find(i => i.family === 'IPv4' && !i.internal).address,
|
|
||||||
host: 'localhost',
|
|
||||||
port: parseInt(env.VITE_PORT ?? 5173),
|
port: parseInt(env.VITE_PORT ?? 5173),
|
||||||
hmr: {
|
|
||||||
host: 'localhost',
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
plugins: [ vue(), splitVendorChunkPlugin() ],
|
plugins: [ vue(), splitVendorChunkPlugin() ],
|
||||||
resolve: {
|
resolve: {
|
||||||
vue: 'vue/dist/vue.esm-bundler.js',
|
vue: 'vue/dist/vue.esm-bundler.js',
|
||||||
},
|
},
|
||||||
build: {
|
|
||||||
chunkSizeWarningLimit: 2048,
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user