perf: use templateParameters to refine index.html (#1156)

* 优化html模板
This commit is contained in:
happystory 2018-10-09 15:23:27 +08:00 committed by 花裤衩
parent b0bd91cd0f
commit 4780ac334f
3 changed files with 8 additions and 4 deletions

View file

@ -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,
},
}),
]
})

View file

@ -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,

View file

@ -8,7 +8,7 @@
<title>vue-element-admin</title>
</head>
<body>
<script src=<%= htmlWebpackPlugin.options.path %>/tinymce4.7.5/tinymce.min.js></script>
<script src=<%= BASE_URL %>/tinymce4.7.5/tinymce.min.js></script>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>