import { defineConfig } from 'vite' import vue from '@vitejs/plugin-vue' import path from 'path' export default defineConfig({ base: "./", //设置打包路径 // 打包配置 // build: { // sourcemap: true, // outDir: 'distp', // 指定输出路径,要和库的包区分开 // assetsDir: 'static/img/', // 指定生成静态资源的存放路径 // brotliSize: false, // 不统计 // target: 'esnext', // minify: 'esbuild', // 混淆器,terser构建后文件体积更小 // rollupOptions: { // output: { // chunkFileNames: 'static/js/[name]-[hash].js', // entryFileNames: 'static/js/[name]-[hash].js', // assetFileNames: 'static/[ext]/[name]-[hash].[ext]' // }, // } // }, plugins: [vue()], resolve: { alias: { '@': path.resolve(__dirname, './src') // 设置别名 } }, build:{ outDir:'dist', assetsDir:'static' }, // server: { // host: '0.0.0.0', // port: 6090, //设置服务启动端口 // //open: true, //设置服务启动时是否自动打开浏览器 // cors: true, //默认启用并允许任何源 // //设置代理 // proxy: { // '/api': { // target: 'http://114.242.31.4:6090', //请求的域名地址 // changeOrigin: true, //是否允许跨域代理 // secure: false, // rewrite: (path) => path.replace(/^\/api/, '') // 重定向地址 // } // } // }, css: { preprocessorOptions: { scss: { // 关闭编译时 字符编码 报错问题 charset: false, }, }, }, })