Build script: copy other files
This commit is contained in:
parent
ec7e74c39d
commit
99cd35287b
2 changed files with 16 additions and 1 deletions
15
dc09.js
15
dc09.js
|
@ -94,6 +94,8 @@ function buildOne(dir) {
|
|||
convertPathsHtml(dir, files)
|
||||
print('Minifying HTML')
|
||||
minifyHtml(dir, files)
|
||||
print('Copying other files')
|
||||
copyOther(dir, files)
|
||||
}
|
||||
|
||||
function minifyJs(dir, files) {
|
||||
|
@ -178,6 +180,19 @@ function minifyHtml(dir, files) {
|
|||
}
|
||||
}
|
||||
|
||||
function copyOther(dir, files) {
|
||||
files.other = files.other || []
|
||||
for (let file of files.other) {
|
||||
const isAbs = path.isAbsolute(file)
|
||||
const name = (isAbs ? file : `${dir}/${file}`)
|
||||
const built = (isAbs ? file : `dist/${dir}/${file}`)
|
||||
fs.cpSync(name, built, {
|
||||
recursive: true,
|
||||
errorOnExist: false,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function archive() {
|
||||
exec('7z a dist.zip dist/*')
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
"js/control.js",
|
||||
"js/handlers.js"
|
||||
],
|
||||
"files": [
|
||||
"other": [
|
||||
"img/", "svg/", "fontawesome/",
|
||||
".domains"
|
||||
]
|
||||
|
|
Loading…
Add table
Reference in a new issue