修复--no-clean
parent
239ebe6cf3
commit
6af38aad87
7
index.js
7
index.js
|
@ -22,10 +22,8 @@ const NODE_VERSION = process.versions.node.split('.').map(n => +n)
|
||||||
|
|
||||||
let args = process.argv.slice(2)
|
let args = process.argv.slice(2)
|
||||||
let mode = args.shift() || 'prod'
|
let mode = args.shift() || 'prod'
|
||||||
let clean, verbose
|
let clean = !args.includes('--no-clean') //
|
||||||
args = args.join(' ')
|
let verbose = args.includes('--verbose') //
|
||||||
clean = args.includes('--no-clean') //
|
|
||||||
verbose = args.includes('--verbose') //
|
|
||||||
|
|
||||||
if (NODE_VERSION[0] < 16 || (NODE_VERSION[0] === 16 && NODE_VERSION[1] < 6)) {
|
if (NODE_VERSION[0] < 16 || (NODE_VERSION[0] === 16 && NODE_VERSION[1] < 6)) {
|
||||||
console.log(red('Error: 你当前的环境不满足 fite 构建工具的要求'))
|
console.log(red('Error: 你当前的环境不满足 fite 构建工具的要求'))
|
||||||
|
@ -58,6 +56,7 @@ switch (mode) {
|
||||||
.then(function (conf) {
|
.then(function (conf) {
|
||||||
let dist = conf.buildDir || 'dist'
|
let dist = conf.buildDir || 'dist'
|
||||||
if (clean && fs.isdir(dist)) {
|
if (clean && fs.isdir(dist)) {
|
||||||
|
console.log('清除dist目录...')
|
||||||
fs.rm(dist)
|
fs.rm(dist)
|
||||||
}
|
}
|
||||||
compile(WORK_SPACE, dist, conf.default, verbose)
|
compile(WORK_SPACE, dist, conf.default, verbose)
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "fite",
|
"name": "fite",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "1.1.7",
|
"version": "1.1.8",
|
||||||
"bin": {
|
"bin": {
|
||||||
"fite": "index.js"
|
"fite": "index.js"
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue