调整代码生成和分包列入热更新开发范围
This commit is contained in:
20
bin/clean.js
Normal file
20
bin/clean.js
Normal file
@@ -0,0 +1,20 @@
|
||||
const fs = require("fs");
|
||||
const fse = require("fs-extra")
|
||||
const path = require("path");
|
||||
const getDirs = (dir, list = [], cb) => {
|
||||
const dirs = fs.readdirSync(dir, {withFileTypes: true})
|
||||
dirs.map(d => {
|
||||
if (d.isDirectory()) {
|
||||
let p = path.join(dir, d.name)
|
||||
list.push(p)
|
||||
if (cb(d, p)) getDirs(p, list, cb)
|
||||
}
|
||||
})
|
||||
return list
|
||||
}
|
||||
getDirs(path.join(__dirname, '..', 'src'), [], (dir, path) => {
|
||||
if (dir.name == "apps") {
|
||||
fse.remove(path)
|
||||
}
|
||||
return dir.name != "apps"
|
||||
})
|
||||
Reference in New Issue
Block a user