| 1234567891011121314151617181920212223242526272829303132333435363738 |
- import {
- defineConfig
- } from 'vite';
- import uni from '@dcloudio/vite-plugin-uni';
- export default defineConfig({
- plugins: [
- uni()
- ],
- server: {
- host: '127.0.0.1',
- port: 8080,
- proxy: {
- '/api': {
- target: 'http://localhost:8085',
- changeOrigin: true,
- rewrite: (path) => path.replace(/^\/api/, ''), // 此处进行路径重写
- }
- }
- },
- build: {
- minify: 'terser',
- terserOptions: {
- compress: {
- drop_console: true, // 移除console
- drop_debugger: true // 移除debugger
- }
- },
- rollupOptions: {
- output: {
- manualChunks: {
- // 将第三方库单独打包
- vendor: ['vue', 'vuex', 'vue-i18n']
- }
- }
- }
- }
- });
|