From 8cdcf2416c12f2e3ab8a0a14e7e764fed3e9e4d8 Mon Sep 17 00:00:00 2001 From: iizmg Date: Tue, 28 Apr 2020 10:21:27 +0800 Subject: [PATCH] =?UTF-8?q?=E7=98=A6=E8=BA=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- admin/build/webpack.base.conf.js | 8 ++ admin/config/index.js | 2 +- admin/index.html | 7 ++ admin/package.json | 9 +- admin/src/api/user.js | 1 - admin/src/assets/js/glob.js | 6 +- admin/src/element.js | 104 ----------------------- admin/src/main.js | 5 -- admin/src/router/index.js | 7 +- admin/test/unit/specs/HelloWorld.spec.js | 11 --- 10 files changed, 20 insertions(+), 140 deletions(-) delete mode 100644 admin/src/element.js delete mode 100644 admin/test/unit/specs/HelloWorld.spec.js diff --git a/admin/build/webpack.base.conf.js b/admin/build/webpack.base.conf.js index 24c9fbf..13a0900 100644 --- a/admin/build/webpack.base.conf.js +++ b/admin/build/webpack.base.conf.js @@ -24,6 +24,14 @@ module.exports = { entry: { app: ['babel-polyfill','./src/main.js'] }, + // 在这个位置添加externals设置: + externals: { + 'vue': 'Vue', + 'vue-router': 'VueRouter', + 'element-ui': 'ELEMENT', + 'axios': 'Axios', + 'nprogress':'NProgress' + }, output: { path: config.build.assetsRoot, filename: '[name].js', diff --git a/admin/config/index.js b/admin/config/index.js index 50c0140..7e224a4 100644 --- a/admin/config/index.js +++ b/admin/config/index.js @@ -64,7 +64,7 @@ module.exports = { // Surge or Netlify already gzip all static assets for you. // Before setting to `true`, make sure to: // npm install --save-dev compression-webpack-plugin - productionGzip: false, + productionGzip: true, productionGzipExtensions: ['js', 'css'], // Run the build command with an extra argument to diff --git a/admin/index.html b/admin/index.html index 38c521e..feebca5 100644 --- a/admin/index.html +++ b/admin/index.html @@ -4,6 +4,13 @@ + + + + + + + <%=process.env.VUE_APP_TITLE%>