Skip to content

Commit

Permalink
fix(cli-service): fix copy plugin's ignore pattern (fix #3119) (#3130)
Browse files Browse the repository at this point in the history
* fix(cli-service): don't skip copiying of files named "index.html"
when nested in a subfolder in /public

close #3119

* refactor: remove the unused '/index.html' pattern
  • Loading branch information
LinusBorg authored and sodatea committed Jan 7, 2019
1 parent 4070507 commit 8b4471e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions packages/@vue/cli-service/__tests__/build.spec.js
Expand Up @@ -13,6 +13,8 @@ test('build', async () => {

// test public copy
project.write('public/foo.js', '1')
// make sure that only /public/index.html is skipped (#3119)
project.write('public/subfolder/index.html', '1')

const { stdout } = await project.run('vue-cli-service build')
expect(stdout).toMatch('Build complete.')
Expand All @@ -22,6 +24,7 @@ test('build', async () => {
expect(project.has('dist/js')).toBe(true)
expect(project.has('dist/css')).toBe(true)
expect(project.has('dist/foo.js')).toBe(true)
expect(project.has('dist/subfolder/index.html')).toBe(true)

const index = await project.read('dist/index.html')
// should split and preload app.js & vendor.js
Expand Down
2 changes: 1 addition & 1 deletion packages/@vue/cli-service/lib/config/app.js
Expand Up @@ -140,7 +140,7 @@ module.exports = (api, options) => {
const multiPageConfig = options.pages
const htmlPath = api.resolve('public/index.html')
const defaultHtmlPath = path.resolve(__dirname, 'index-default.html')
const publicCopyIgnore = ['index.html', '.DS_Store']
const publicCopyIgnore = ['.DS_Store']

if (!multiPageConfig) {
// default, single page setup.
Expand Down

0 comments on commit 8b4471e

Please sign in to comment.