Skip to content

Commit 8b4471e

Browse files
LinusBorghaoqunjiang
authored andcommitted
fix(cli-service): fix copy plugin's ignore pattern (fix #3119) (#3130)
* 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
1 parent 4070507 commit 8b4471e

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

packages/@vue/cli-service/__tests__/build.spec.js

+3
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ test('build', async () => {
1313

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

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

2629
const index = await project.read('dist/index.html')
2730
// should split and preload app.js & vendor.js

packages/@vue/cli-service/lib/config/app.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ module.exports = (api, options) => {
140140
const multiPageConfig = options.pages
141141
const htmlPath = api.resolve('public/index.html')
142142
const defaultHtmlPath = path.resolve(__dirname, 'index-default.html')
143-
const publicCopyIgnore = ['index.html', '.DS_Store']
143+
const publicCopyIgnore = ['.DS_Store']
144144

145145
if (!multiPageConfig) {
146146
// default, single page setup.

0 commit comments

Comments
 (0)