Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions packages/@vue/cli-service/lib/config/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,15 +214,19 @@ module.exports = (api, options) => {
const entries = Array.isArray(entry) ? entry : [entry]
webpackConfig.entry(name).merge(entries.map(e => api.resolve(e)))

// trim inline loader
// * See https://github.com/jantimon/html-webpack-plugin/blob/master/docs/template-option.md#2-setting-a-loader-directly-for-the-template
const templateWithoutLoader = template.replace(/^.+!/, '').replace(/\?.+$/, '')

// resolve page index template
const hasDedicatedTemplate = fs.existsSync(api.resolve(template))
const hasDedicatedTemplate = fs.existsSync(api.resolve(templateWithoutLoader))
const templatePath = hasDedicatedTemplate
? template
: fs.existsSync(htmlPath)
? htmlPath
: defaultHtmlPath

publicCopyIgnore.push(api.resolve(templatePath).replace(/\\/g, '/'))
publicCopyIgnore.push(api.resolve(templateWithoutLoader).replace(/\\/g, '/'))

// inject html plugin for the page
const pageHtmlOptions = Object.assign(
Expand Down