- update port for developmnet mode

This commit is contained in:
Kamil Niemczycki 2023-07-30 13:33:56 +02:00
parent cd66fd6ffa
commit b05378ea2e
Signed by: kamilniemczycki
GPG Key ID: 04D4E2012F969213
2 changed files with 23 additions and 10 deletions

View File

@ -1,4 +1,5 @@
VITE_APP_NAME="Kamil Niemczycki CV"
VITE_CV_URL="http://localhost:5173"
VITE_PORT=5173
VITE_API_URL="http://localhost"
VITE_SOURCE_CODE="https://github.com/kamilniemczycki"

View File

@ -1,13 +1,25 @@
import { defineConfig, splitVendorChunkPlugin } from 'vite'
import vue from '@vitejs/plugin-vue'
import { defineConfig, loadEnv, splitVendorChunkPlugin } from 'vite';
import vue from '@vitejs/plugin-vue';
import { networkInterfaces } from 'os';
// https://vitejs.dev/config/
export default defineConfig({
plugins: [ vue(), splitVendorChunkPlugin() ],
resolve: {
vue: 'vue/dist/vue.esm-bundler.js',
},
build: {
chunkSizeWarningLimit: 2048,
},
export default defineConfig((mode) => {
const env = loadEnv(mode, process.cwd(), "");
return {
server: {
//host: Object.values(networkInterfaces()).flat().find(i => i.family === 'IPv4' && !i.internal).address,
host: 'localhost',
port: parseInt(env.VITE_PORT ?? 5173),
hmr: {
host: 'localhost',
},
},
plugins: [ vue(), splitVendorChunkPlugin() ],
resolve: {
vue: 'vue/dist/vue.esm-bundler.js',
},
build: {
chunkSizeWarningLimit: 2048,
},
};
});