Skip to content

Commit

Permalink
fix: fix build --dest option (vuejs#6314)
Browse files Browse the repository at this point in the history
Closes vuejs#6312
  • Loading branch information
haoqunjiang authored Mar 10, 2021
1 parent f4fb99d commit 7c580b8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
14 changes: 14 additions & 0 deletions packages/@vue/cli-service/__tests__/build.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,20 @@ test('build with --report-json', async () => {
expect(appChunk).toHaveProperty('modules')
})

test('build with --dest', async () => {
const project = await create('e2e-build-dest', defaultPreset)

const { stdout } = await project.run('vue-cli-service build --dest other_dist')
expect(stdout).toMatch('Build complete.')

expect(project.has('other_dist/index.html')).toBe(true)
expect(project.has('other_dist/favicon.ico')).toBe(true)
expect(project.has('other_dist/js')).toBe(true)
expect(project.has('other_dist/css')).toBe(true)

expect(project.has('dist')).toBe(false)
})

afterAll(async () => {
if (browser) {
await browser.close()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module.exports = (api, args, options) => {
// respect inline build destination in copy plugin
if (args.dest && config.plugins.has('copy')) {
config.plugin('copy').tap(pluginArgs => {
pluginArgs[0][0].to = targetDir
pluginArgs[0].patterns.to = targetDir
return pluginArgs
})
}
Expand Down

0 comments on commit 7c580b8

Please sign in to comment.