| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- import { defineConfig } from 'vite';
- import vue from '@vitejs/plugin-vue';
- // import vueDevTools from 'vite-plugin-vue-devtools';
- // https://vitejs.dev/config/
- export default defineConfig({
- /**
- * 项目根目录
- * @see https://cn.vite.dev/config/shared-options.html#root
- */
- root: './src',
- /**
- * 静态资源目录,相对于 src/index.html 文件
- * @see https://cn.vite.dev/config/shared-options.html#publicdir
- */
- publicDir: '../public',
- base: './',
- server: {
- port: 5173,
- host: '0.0.0.0', // IP配置,支持从IP启动
- proxy: {
- '/iaserverapi': {
- // target: 'http://192.168.141.78:5678',
- // target: 'http://172.20.10.3:5678',
- // target: 'http://192.168.0.100:5678',
- target: 'http://47.117.92.63:5678/',
- // target: 'http://ty.bai.sc.sgcc.com.cn',
- // target: 'http://25.214.216.111:9000',
- changeOrigin: true,
- secure: false,
- ws: true,
- // rewrite: (path) => path.replace(/^\/iaserverapi/, '')
- }
- }
- },
- build: {
- /**
- * 构建输出目录,相对于 src/index.html 文件
- * @see https://cn.vite.dev/config/build-options.html#build-outdir
- */
- outDir: '../dist',
- assetsDir: 'static',
- assetsInclude: ['**/*.exe'], // 显式包含.exe文件类型
- emptyOutDir: true,
- target: ['es2022', 'edge85'],
- terserOptions: {
- compress: {
- drop_console: true, // 移除 console 语句
- drop_debugger: true // 移除 debugger 语句
- }
- }
- },
- plugins: [
- vue()
- /**
- * @see https://devtools.vuejs.org/guide/vite-plugin
- */
- // vueDevTools({
- // launchEditor: 'code'
- // })
- ],
- });
|