From 684533cee9edecd56dbc544f7a5847038c21f8a1 Mon Sep 17 00:00:00 2001 From: chenghongxing <1126263215@qq.com> Date: Sat, 26 Sep 2020 17:48:56 +0800 Subject: [PATCH] Merge pull request #123 from guoranred/master; --- babel.config.js | 10 +++- package.json | 12 +++-- public/index.html | 8 +++ src/layouts/header/HeaderSearch.vue | 1 + src/router/guards.js | 35 +++++++++++-- src/theme/default/index.less | 1 + src/theme/default/nprogress.less | 76 +++++++++++++++++++++++++++++ vue.config.js | 63 +++++++++++++++++++++++- 8 files changed, 197 insertions(+), 9 deletions(-) create mode 100644 src/theme/default/nprogress.less diff --git a/babel.config.js b/babel.config.js index e955840..4eb72d0 100644 --- a/babel.config.js +++ b/babel.config.js @@ -1,5 +1,13 @@ +const IS_PROD = ['production', 'prod'].includes(process.env.NODE_ENV) + +const plugins = [] +if (IS_PROD) { + plugins.push('transform-remove-console') +} + module.exports = { presets: [ '@vue/cli-plugin-babel/preset' - ] + ], + plugins } diff --git a/package.json b/package.json index 69e970d..652e756 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,10 @@ "build": "vue-cli-service build", "lint": "vue-cli-service lint", "predeploy": "yarn build", - "deploy": "gh-pages -d dist -b pages -r https://gitee.com/iczer/vue-antd-admin.git" + "deploy": "gh-pages -d dist -b pages -r https://gitee.com/iczer/vue-antd-admin.git", + "docs:dev": "vuepress dev docs", + "docs:build": "vuepress build docs", + "docs:deploy": "vuepress build docs && gh-pages -d docs/.vuepress/dist -b master -r https://gitee.com/iczer/vue-antd-admin-docs.git" }, "dependencies": { "@antv/data-set": "^0.11.4", @@ -26,7 +29,8 @@ "vue-i18n": "^8.18.2", "vue-router": "^3.3.4", "vuedraggable": "^2.23.2", - "vuex": "^3.4.0" + "vuex": "^3.4.0", + "nprogress": "^0.2.0" }, "devDependencies": { "@ant-design/colors": "^4.0.1", @@ -47,7 +51,9 @@ "vue-template-compiler": "^2.6.11", "vuepress": "^1.5.2", "webpack-theme-color-replacer": "^1.3.12", - "whatwg-fetch": "^3.0.0" + "whatwg-fetch": "^3.0.0", + "compression-webpack-plugin": "^2.0.0", + "babel-plugin-transform-remove-console": "^6.9.4" }, "eslintConfig": { "root": true, diff --git a/public/index.html b/public/index.html index 61725f6..719a471 100644 --- a/public/index.html +++ b/public/index.html @@ -6,12 +6,20 @@