Skip to content

Commit c19bbff

Browse files
arthurdenneryyx990803
authored andcommitted
feat(cli-service): support --no-clean flag (#1457)
close #1446
1 parent ec87266 commit c19bbff

File tree

1 file changed

+5
-1
lines changed
  • packages/@vue/cli-service/lib/commands/build

1 file changed

+5
-1
lines changed

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

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
const defaults = {
2+
clean: true,
23
target: 'app',
34
entry: 'src/App.vue'
45
}
@@ -18,6 +19,7 @@ module.exports = (api, options) => {
1819
'--dest': `specify output directory (default: ${options.outputDir})`,
1920
'--target': `app | lib | wc | wc-async (default: ${defaults.target})`,
2021
'--name': `name for lib or web-component mode (default: "name" in package.json or entry filename)`,
22+
'--no-clean': `do not remove the dist directory before building the project`,
2123
'--watch': `watch for changes`
2224
}
2325
}, async function build (args) {
@@ -125,7 +127,9 @@ module.exports = (api, options) => {
125127
process.exit(1)
126128
}
127129

128-
await fs.remove(targetDir)
130+
if (args.clean) {
131+
await fs.remove(targetDir)
132+
}
129133

130134
// Expose advanced stats
131135
if (args.dashboard) {

0 commit comments

Comments
 (0)