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() {
|
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)
|
print('Completed', true, 'V', green)
|
||||||
}
|
}
|
||||||
|
|
||||||
function buildOne(dir) {
|
function buildOne(dir) {
|
||||||
|
|
||||||
print(`${bold}Building:${reset} ${dir}`)
|
print(`${bold}Building:${reset} ${dir}`)
|
||||||
fs.mkdirSync(`dist/${dir}`, {recursive: true})
|
|
||||||
|
|
||||||
const config = `${dir}/webpage.json`
|
const config = `${dir}/webpage.json`
|
||||||
let files
|
let files
|
||||||
|
@ -84,6 +97,10 @@ function buildOne(dir) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fs.mkdirSync(`dist/${dir}`, {
|
||||||
|
recursive: true
|
||||||
|
})
|
||||||
|
|
||||||
print('Minifying JS')
|
print('Minifying JS')
|
||||||
minifyJs(dir, files)
|
minifyJs(dir, files)
|
||||||
print('Rendering LESS')
|
print('Rendering LESS')
|
||||||
|
|
Loading…
Add table
Reference in a new issue