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%>