Skip to content

Commit

Permalink
feat(cli-service): support --no-clean flag (#1457)
Browse files Browse the repository at this point in the history
close #1446
  • Loading branch information
arthurdenner authored and yyx990803 committed Jun 5, 2018
1 parent ec87266 commit c19bbff
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/@vue/cli-service/lib/commands/build/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const defaults = {
clean: true,
target: 'app',
entry: 'src/App.vue'
}
Expand All @@ -18,6 +19,7 @@ module.exports = (api, options) => {
'--dest': `specify output directory (default: ${options.outputDir})`,
'--target': `app | lib | wc | wc-async (default: ${defaults.target})`,
'--name': `name for lib or web-component mode (default: "name" in package.json or entry filename)`,
'--no-clean': `do not remove the dist directory before building the project`,
'--watch': `watch for changes`
}
}, async function build (args) {
Expand Down Expand Up @@ -125,7 +127,9 @@ module.exports = (api, options) => {
process.exit(1)
}

await fs.remove(targetDir)
if (args.clean) {
await fs.remove(targetDir)
}

// Expose advanced stats
if (args.dashboard) {
Expand Down

0 comments on commit c19bbff

Please sign in to comment.