Skip to content

Copy plugin's ignore pattern bug in Multiple html #3597

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
woshilaoge opened this issue Mar 9, 2019 · 1 comment · Fixed by #4613
Closed

Copy plugin's ignore pattern bug in Multiple html #3597

woshilaoge opened this issue Mar 9, 2019 · 1 comment · Fixed by #4613

Comments

@woshilaoge
Copy link

woshilaoge commented Mar 9, 2019

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.

@luckymore
Copy link

遇到了一样的问题呢 😭

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants