import { fileURLToPath, URL } from 'node:url' import { defineConfig } from 'vite' import vue from '@vitejs/plugin-vue' import vueJsx from '@vitejs/plugin-vue-jsx' // https://vitejs.dev/config/ export default defineConfig({ // base: '/highLevelIntellectual/', build: { chunkSizeWarningLimit: 1500, rollupOptions: { output: { // 最小化拆分包 manualChunks(id) { if (id.includes('node_modules')) { return id.toString().split('node_modules/')[1].split('/')[0].toString() } }, // 用于从入口点创建的块的打包输出格式[name]表示文件名,[hash]表示该文件内容hash值 entryFileNames: 'assets/js/[name].[hash].js', // 用于命名代码拆分时创建的共享块的输出命名 chunkFileNames: 'assets/js/[name].[hash].js', // 用于输出静态资源的命名,[ext]表示文件扩展名 assetFileNames: 'assets/[ext]/[name].[hash].[ext]' } } }, base: '/fireBrigadeUser/', css: { preprocessorOptions: { scss: { api: "modern-compiler" // or 'modern' } } }, plugins: [ vue(), vueJsx(), ], server: { // ← ← ← ← ← ← host: '0.0.0.0', // ← 新增内容 ← // port: 8991, }, resolve: { alias: { '@': fileURLToPath(new URL('./src', import.meta.url)) } } })