Skip to content

Commit 7c580b8

Browse files
authored
fix: fix build --dest option (#6314)
Closes #6312
1 parent f4fb99d commit 7c580b8

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,20 @@ test('build with --report-json', async () => {
9191
expect(appChunk).toHaveProperty('modules')
9292
})
9393

94+
test('build with --dest', async () => {
95+
const project = await create('e2e-build-dest', defaultPreset)
96+
97+
const { stdout } = await project.run('vue-cli-service build --dest other_dist')
98+
expect(stdout).toMatch('Build complete.')
99+
100+
expect(project.has('other_dist/index.html')).toBe(true)
101+
expect(project.has('other_dist/favicon.ico')).toBe(true)
102+
expect(project.has('other_dist/js')).toBe(true)
103+
expect(project.has('other_dist/css')).toBe(true)
104+
105+
expect(project.has('dist')).toBe(false)
106+
})
107+
94108
afterAll(async () => {
95109
if (browser) {
96110
await browser.close()

packages/@vue/cli-service/lib/commands/build/resolveAppConfig.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ module.exports = (api, args, options) => {
1212
// respect inline build destination in copy plugin
1313
if (args.dest && config.plugins.has('copy')) {
1414
config.plugin('copy').tap(pluginArgs => {
15-
pluginArgs[0][0].to = targetDir
15+
pluginArgs[0].patterns.to = targetDir
1616
return pluginArgs
1717
})
1818
}

0 commit comments

Comments
 (0)