From 4780ac334f808922df0d1a7929e5ad42a2402c07 Mon Sep 17 00:00:00 2001 From: happystory <670652018@qq.com> Date: Tue, 9 Oct 2018 15:23:27 +0800 Subject: [PATCH] perf: use templateParameters to refine index.html (#1156) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 优化html模板 --- build/webpack.dev.conf.js | 6 ++++-- build/webpack.prod.conf.js | 4 +++- index.html | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/build/webpack.dev.conf.js b/build/webpack.dev.conf.js index 5eba7eb3..26a5584a 100644 --- a/build/webpack.dev.conf.js +++ b/build/webpack.dev.conf.js @@ -58,8 +58,10 @@ const devWebpackConfig = merge(baseWebpackConfig, { inject: true, favicon: resolve('favicon.ico'), title: 'vue-element-admin', - path: config.dev.assetsPublicPath + config.dev.assetsSubDirectory - }) + templateParameters: { + BASE_URL: config.dev.assetsPublicPath + config.dev.assetsSubDirectory, + }, + }), ] }) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js index 01f85732..946a134a 100644 --- a/build/webpack.prod.conf.js +++ b/build/webpack.prod.conf.js @@ -56,7 +56,9 @@ const webpackConfig = merge(baseWebpackConfig, { inject: true, favicon: resolve('favicon.ico'), title: 'vue-element-admin', - path: config.build.assetsPublicPath + config.build.assetsSubDirectory, + templateParameters: { + BASE_URL: config.build.assetsPublicPath + config.build.assetsSubDirectory, + }, minify: { removeComments: true, collapseWhitespace: true, diff --git a/index.html b/index.html index 489d1a53..7a7ecacf 100644 --- a/index.html +++ b/index.html @@ -8,7 +8,7 @@ vue-element-admin - +