Commit 6fddd9ba authored by 尚斌杰's avatar 尚斌杰

修复html-webpack-plugin bug

parent eb5fec9e
......@@ -219,11 +219,11 @@ async function build (args, api, options) {
webpackConfig.output.publicPath = ''
webpackConfig.output.path = targetDir
for(let item of webpackConfig.plugins) {
if (item.options && item.options.template) {
item.options.template = pagePath + '/index.html'
item.options.header = headerTpl
item.options.footer = footerTpl
item.options.common = (commonPath && process.env.NODE_ENV === 'production')?`<link href=${commonPath} rel=preload as=script><script src="${commonPath}"></script>`:''
if (item.userOptions && item.userOptions.template) {
item.userOptions.template = pagePath + '/index.html'
item.userOptions.header = headerTpl
item.userOptions.footer = footerTpl
item.userOptions.common = (commonPath && process.env.NODE_ENV === 'production')?`<link href=${commonPath} rel=preload as=script><script src="${commonPath}"></script>`:''
}
}
for (let item of webpackConfig.module.rules) {
......
......@@ -113,10 +113,10 @@ module.exports = (api, options) => {
app: pagePath + '/index'
}
for(let item of webpackConfig.plugins) {
if (item.options && item.options.template) {
item.options.template = pagePath + '/index.html'
item.options.header = headerTpl
item.options.footer = footerTpl
if (item.userOptions && item.userOptions.template) {
item.userOptions.template = pagePath + '/index.html'
item.userOptions.header = headerTpl
item.userOptions.footer = footerTpl
}
}
} else {
......
{
"name": "vue-cli-plugin-ts-multi-pages",
"version": "2.0.0-alpha.0",
"version": "2.0.0-alpha.1",
"description": "vue-cli3多页开发插件TS版",
"main": "index.js",
"scripts": {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment