Browse Source

feat: 添加线上环境删console插件`vite-plugin-remove-console`

i18n
xiaoxian521 3 years ago
parent
commit
2d7debadff
  1. 1
      package.json
  2. 9
      pnpm-lock.yaml
  3. 3
      vite.config.ts

1
package.json

@ -100,6 +100,7 @@
"vite": "2.6.14", "vite": "2.6.14",
"vite-plugin-full-reload": "^1.0.0", "vite-plugin-full-reload": "^1.0.0",
"vite-plugin-mock": "^2.9.6", "vite-plugin-mock": "^2.9.6",
"vite-plugin-remove-console": "^0.0.5",
"vite-plugin-style-import": "^1.2.1", "vite-plugin-style-import": "^1.2.1",
"vite-svg-loader": "^2.2.0", "vite-svg-loader": "^2.2.0",
"vue-eslint-parser": "7.10.0" "vue-eslint-parser": "7.10.0"

9
pnpm-lock.yaml

@ -67,6 +67,7 @@ specifiers:
vite: 2.6.14 vite: 2.6.14
vite-plugin-full-reload: ^1.0.0 vite-plugin-full-reload: ^1.0.0
vite-plugin-mock: ^2.9.6 vite-plugin-mock: ^2.9.6
vite-plugin-remove-console: ^0.0.5
vite-plugin-style-import: ^1.2.1 vite-plugin-style-import: ^1.2.1
vite-svg-loader: ^2.2.0 vite-svg-loader: ^2.2.0
vue: ^3.2.24 vue: ^3.2.24
@ -148,6 +149,7 @@ devDependencies:
vite: 2.6[email protected] vite: 2.6[email protected]
vite-plugin-full-reload: 1.0.0 vite-plugin-full-reload: 1.0.0
vite-plugin-mock: 2.9[email protected][email protected] vite-plugin-mock: 2.9[email protected][email protected]
vite-plugin-remove-console: 0.0.5
vite-plugin-style-import: 1.3[email protected] vite-plugin-style-import: 1.3[email protected]
vite-svg-loader: 2.2.0 vite-svg-loader: 2.2.0
vue-eslint-parser: 7.10[email protected] vue-eslint-parser: 7.10[email protected]
@ -7109,6 +7111,13 @@ packages:
- supports-color - supports-color
dev: true dev: true
/vite-plugin-remove-console/0.0.5:
resolution:
{
integrity: sha512-bACgR/1rClDu2V5VD8CpBTtg33ujqx3XDn8og8JtyPBzQ5/8LmW5IGmlSmkhVDwzg4KzadT2Ftrdu6v+0n5rVQ==
}
dev: true
/vite-plugin-style-import/[email protected]: /vite-plugin-style-import/[email protected]:
resolution: resolution:
{ {

3
vite.config.ts

@ -7,6 +7,7 @@ import { warpperEnv, regExps } from "./build";
import fullReload from "vite-plugin-full-reload"; import fullReload from "vite-plugin-full-reload";
import { viteMockServe } from "vite-plugin-mock"; import { viteMockServe } from "vite-plugin-mock";
import ElementPlus from "unplugin-element-plus/vite"; import ElementPlus from "unplugin-element-plus/vite";
import removeConsole from "vite-plugin-remove-console";
import { UserConfigExport, ConfigEnv, loadEnv } from "vite"; import { UserConfigExport, ConfigEnv, loadEnv } from "vite";
import themePreprocessorPlugin from "@zougt/vite-plugin-theme-preprocessor"; import themePreprocessorPlugin from "@zougt/vite-plugin-theme-preprocessor";
@ -82,6 +83,8 @@ export default ({ command, mode }: ConfigEnv): UserConfigExport => {
vue(), vue(),
// jsx、tsx语法支持 // jsx、tsx语法支持
vueJsx(), vueJsx(),
// 线上环境删除console
removeConsole(),
// 修改layout文件夹下的文件时自动重载浏览器 解决 https://github.com/xiaoxian521/vue-pure-admin/issues/170 // 修改layout文件夹下的文件时自动重载浏览器 解决 https://github.com/xiaoxian521/vue-pure-admin/issues/170
fullReload(["src/layout/**/*"]), fullReload(["src/layout/**/*"]),
// 自定义主题 // 自定义主题

Loading…
Cancel
Save