Description
Version
3.5.0
Environment info
System:
OS: macOS 10.14
Binaries:
Node: 8.11.4
Yarn: 1.12.3
Browsers:
Chrome: 72.0.3626.121
npmPackages:
@vue/cli-service: ^3.1.2 => 3.5.0
npmGlobalPackages:
@vue/cli: 3.4.1
Steps to reproduce
Create an empty Vue project
Create the following folder structure:
Root/public
Root/public/index.html
Root/public/test/index.html
Set vue.config.js
pages: {
babel: {
entry: 'src/main.js',
template: 'public/index.html',
filename: 'babel.html'
}
}
Run the command npm run build
Open dist folder
What is expected?
├── babel.html
├── css
├── img
├── js
└── test
What is actually happening?
├── babel.html
├── index.html
├── css
├── img
├── js
└── test
Index.html should be ignored because this is a template file
I found the reason and found the previous issue
#3130
#3119
#CHANGELOG 3.3.0
I tried to find the reason and found a problem in this file.(app.js-207)
I found this plugin copy-webpack-plugin(processPatternjs-59) ignore configuration matching rules some problems.
So I queried the document and tried to make changes. Here are the results of my modifications. Then I got the result I wanted.
if (hasDedicatedTemplate) {
//207 line
// publicCopyIgnore.push(template)
publicCopyIgnore.push({ glob: template.replace(/^public\//,''), matchBase: false })
}
Since this version**(3.3.0 (2019-01-08))** was updated, this problem has been around, I don't know if my plan will help you. I am a loyal user of the CLI and hope to fix this problem earlier.