Bugfix in buildOne
, getting directories list in buildAll
This commit is contained in:
parent
99cd35287b
commit
b4cc751b6d
1 changed files with 19 additions and 2 deletions
21
dc09.js
21
dc09.js
|
@ -62,14 +62,27 @@ function main() {
|
|||
|
||||
|
||||
function buildAll() {
|
||||
buildOne('.')
|
||||
|
||||
const dirs = fs.readdirSync('.', {
|
||||
withFileTypes: true
|
||||
})
|
||||
.filter(file => file.isDirectory())
|
||||
.map(file => file.name)
|
||||
|
||||
const pages = [
|
||||
'.',
|
||||
...dirs,
|
||||
]
|
||||
|
||||
for (let page of pages)
|
||||
buildOne(page)
|
||||
|
||||
print('Completed', true, 'V', green)
|
||||
}
|
||||
|
||||
function buildOne(dir) {
|
||||
|
||||
print(`${bold}Building:${reset} ${dir}`)
|
||||
fs.mkdirSync(`dist/${dir}`, {recursive: true})
|
||||
|
||||
const config = `${dir}/webpage.json`
|
||||
let files
|
||||
|
@ -84,6 +97,10 @@ function buildOne(dir) {
|
|||
return
|
||||
}
|
||||
|
||||
fs.mkdirSync(`dist/${dir}`, {
|
||||
recursive: true
|
||||
})
|
||||
|
||||
print('Minifying JS')
|
||||
minifyJs(dir, files)
|
||||
print('Rendering LESS')
|
||||
|
|
Loading…
Add table
Reference in a new issue