From be1612ad23e9f583e9ba4a7185c188311e0e1c85 Mon Sep 17 00:00:00 2001 From: Thorsten Date: Thu, 13 Dec 2018 19:42:01 +0100 Subject: [PATCH 1/2] fix(cli-service): don't skip copiying of files named "index.html" when nested in a subfolder in /public close #3119 --- packages/@vue/cli-service/__tests__/build.spec.js | 3 +++ packages/@vue/cli-service/lib/config/app.js | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/@vue/cli-service/__tests__/build.spec.js b/packages/@vue/cli-service/__tests__/build.spec.js index 2a68ddeb0d..f87ca362f3 100644 --- a/packages/@vue/cli-service/__tests__/build.spec.js +++ b/packages/@vue/cli-service/__tests__/build.spec.js @@ -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.') @@ -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 diff --git a/packages/@vue/cli-service/lib/config/app.js b/packages/@vue/cli-service/lib/config/app.js index 8850efdfc5..1b24ee695c 100644 --- a/packages/@vue/cli-service/lib/config/app.js +++ b/packages/@vue/cli-service/lib/config/app.js @@ -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 = ['/index.html', '.DS_Store'] if (!multiPageConfig) { // default, single page setup. From 209573021cfbf9dccee9e76600fc4d0ddd3ce8d5 Mon Sep 17 00:00:00 2001 From: Haoqun Jiang Date: Mon, 7 Jan 2019 16:14:42 +0800 Subject: [PATCH 2/2] refactor: remove the unused '/index.html' pattern --- packages/@vue/cli-service/lib/config/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/@vue/cli-service/lib/config/app.js b/packages/@vue/cli-service/lib/config/app.js index 1b24ee695c..ba72db29aa 100644 --- a/packages/@vue/cli-service/lib/config/app.js +++ b/packages/@vue/cli-service/lib/config/app.js @@ -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.