From 2d7debadff823c6fecd8f6a80a8e5691653f1304 Mon Sep 17 00:00:00 2001 From: xiaoxian521 <1923740402@qq.com> Date: Fri, 7 Jan 2022 15:29:14 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E7=BA=BF=E4=B8=8A?= =?UTF-8?q?=E7=8E=AF=E5=A2=83=E5=88=A0console=E6=8F=92=E4=BB=B6`vite-plugi?= =?UTF-8?q?n-remove-console`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 1 + pnpm-lock.yaml | 9 +++++++++ vite.config.ts | 3 +++ 3 files changed, 13 insertions(+) diff --git a/package.json b/package.json index 461cef8..30f1107 100644 --- a/package.json +++ b/package.json @@ -100,6 +100,7 @@ "vite": "2.6.14", "vite-plugin-full-reload": "^1.0.0", "vite-plugin-mock": "^2.9.6", + "vite-plugin-remove-console": "^0.0.5", "vite-plugin-style-import": "^1.2.1", "vite-svg-loader": "^2.2.0", "vue-eslint-parser": "7.10.0" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e229637..5164c48 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -67,6 +67,7 @@ specifiers: vite: 2.6.14 vite-plugin-full-reload: ^1.0.0 vite-plugin-mock: ^2.9.6 + vite-plugin-remove-console: ^0.0.5 vite-plugin-style-import: ^1.2.1 vite-svg-loader: ^2.2.0 vue: ^3.2.24 @@ -148,6 +149,7 @@ devDependencies: vite: 2.6.14_sass@1.45.0 vite-plugin-full-reload: 1.0.0 vite-plugin-mock: 2.9.6_mockjs@1.1.0+vite@2.6.14 + vite-plugin-remove-console: 0.0.5 vite-plugin-style-import: 1.3.0_vite@2.6.14 vite-svg-loader: 2.2.0 vue-eslint-parser: 7.10.0_eslint@7.30.0 @@ -7109,6 +7111,13 @@ packages: - supports-color dev: true + /vite-plugin-remove-console/0.0.5: + resolution: + { + integrity: sha512-bACgR/1rClDu2V5VD8CpBTtg33ujqx3XDn8og8JtyPBzQ5/8LmW5IGmlSmkhVDwzg4KzadT2Ftrdu6v+0n5rVQ== + } + dev: true + /vite-plugin-style-import/1.3.0_vite@2.6.14: resolution: { diff --git a/vite.config.ts b/vite.config.ts index e39d425..c8ca3e2 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -7,6 +7,7 @@ import { warpperEnv, regExps } from "./build"; import fullReload from "vite-plugin-full-reload"; import { viteMockServe } from "vite-plugin-mock"; import ElementPlus from "unplugin-element-plus/vite"; +import removeConsole from "vite-plugin-remove-console"; import { UserConfigExport, ConfigEnv, loadEnv } from "vite"; import themePreprocessorPlugin from "@zougt/vite-plugin-theme-preprocessor"; @@ -82,6 +83,8 @@ export default ({ command, mode }: ConfigEnv): UserConfigExport => { vue(), // jsx、tsx语法支持 vueJsx(), + // 线上环境删除console + removeConsole(), // 修改layout文件夹下的文件时自动重载浏览器 解决 https://github.com/xiaoxian521/vue-pure-admin/issues/170 fullReload(["src/layout/**/*"]), // 自定义主题