Skip to content

Commit 57ce32a

Browse files
committed
fix: respect --dest when copying static assets (close #909)
1 parent 89982df commit 57ce32a

File tree

1 file changed

+11
-6
lines changed
  • packages/@vue/cli-service/lib/commands/build

1 file changed

+11
-6
lines changed

Diff for: packages/@vue/cli-service/lib/commands/build/index.js

+11-6
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,17 @@ module.exports = (api, options) => {
5858

5959
// respect inline build destination
6060
if (args.dest) {
61-
api.configureWebpack({
62-
output: {
63-
path: path.resolve(
64-
api.service.context,
65-
args.dest
66-
)
61+
const dest = path.resolve(
62+
api.service.context,
63+
args.dest
64+
)
65+
api.chainWebpack(config => {
66+
config.output.path(dest)
67+
if (args.target === 'app') {
68+
config.plugin('copy').tap(args => {
69+
args[0][0].to = dest
70+
return args
71+
})
6772
}
6873
})
6974
}

0 commit comments

Comments
 (0)