Skip to content

Commit

Permalink
新增output可配置
Browse files Browse the repository at this point in the history
  • Loading branch information
Taoja committed May 13, 2020
1 parent 65cbd35 commit 9fefc59
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion bin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,22 @@ const config = require('../lib/config')
const resolve = require('../lib/resolve')
const options = require('../config/options')
const { isDev } = require('../lib/args')
const {__isEmptyObject} = require('../lib/help')

var output
if (__isEmptyObject(config.default.output)) {
output = resolve('dist')
} else if (typeof config.default.output == 'string') {
output = resolve(config.default.output)
} else if (typeof config.default.output == 'object') {
output = config.default.output.path
}

const rm = function () {
if (isDev) {
options()
} else {
rmrf(resolve(config.default.output), function() {
rmrf(resolve(output), function() {
options()
})
}
Expand Down

0 comments on commit 9fefc59

Please sign in to comment.