Bugfix in buildOne, getting directories list in buildAll

This commit is contained in:
DarkCat09 2022-12-30 15:57:06 +04:00
parent 99cd35287b
commit b4cc751b6d

21
dc09.js
View file

@ -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')