|
@@ -2,8 +2,8 @@
|
|
import { resolve } from 'path';
|
|
import { resolve } from 'path';
|
|
import { ConfigEnv, UserConfig } from 'vite';
|
|
import { ConfigEnv, UserConfig } from 'vite';
|
|
// import { wrapperEnv } from './build/utils';
|
|
// import { wrapperEnv } from './build/utils';
|
|
-import Components from 'unplugin-vue-components/vite'
|
|
|
|
-import { VantResolver } from 'unplugin-vue-components/resolvers'
|
|
|
|
|
|
+import Components from 'unplugin-vue-components/vite';
|
|
|
|
+import { VantResolver } from 'unplugin-vue-components/resolvers';
|
|
import vue from '@vitejs/plugin-vue';
|
|
import vue from '@vitejs/plugin-vue';
|
|
const pathResolve = (dir: string) => {
|
|
const pathResolve = (dir: string) => {
|
|
return resolve(process.cwd(), '.', dir);
|
|
return resolve(process.cwd(), '.', dir);
|
|
@@ -39,25 +39,25 @@ export default function (_: ConfigEnv): UserConfig {
|
|
},
|
|
},
|
|
server: {
|
|
server: {
|
|
proxy: {
|
|
proxy: {
|
|
- "/service": {
|
|
|
|
- target: "https://v4-uat.4dkankan.com/",
|
|
|
|
|
|
+ '/service': {
|
|
|
|
+ target: 'https://v4-uat.4dkankan.com/',
|
|
changeOrigin: true,
|
|
changeOrigin: true,
|
|
- rewrite: (path) => path.replace(/^\/api/, ""),
|
|
|
|
|
|
+ rewrite: (path) => path.replace(/^\/api/, ''),
|
|
},
|
|
},
|
|
},
|
|
},
|
|
},
|
|
},
|
|
plugins: [
|
|
plugins: [
|
|
vue(),
|
|
vue(),
|
|
Components({
|
|
Components({
|
|
- resolvers: [VantResolver()]
|
|
|
|
- })
|
|
|
|
|
|
+ resolvers: [VantResolver()],
|
|
|
|
+ }),
|
|
],
|
|
],
|
|
build: {
|
|
build: {
|
|
minify: 'terser',
|
|
minify: 'terser',
|
|
terserOptions: {
|
|
terserOptions: {
|
|
compress: {
|
|
compress: {
|
|
//生产环境时移除console
|
|
//生产环境时移除console
|
|
- drop_console: true,
|
|
|
|
|
|
+ drop_console: false,
|
|
drop_debugger: true,
|
|
drop_debugger: true,
|
|
},
|
|
},
|
|
},
|
|
},
|