Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(cli-service): support --no-clean flag #1457

Merged
merged 2 commits into from
Jun 5, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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