forked from svrjs/svrjs
Make the build script also pack empty directories into zip file
This commit is contained in:
parent
1444660d19
commit
57ce4018dc
1 changed files with 7 additions and 11 deletions
|
@ -217,17 +217,13 @@ esbuild
|
||||||
archive.pipe(output);
|
archive.pipe(output);
|
||||||
|
|
||||||
// Add everything in the "dist" directory except for "svr.js" and "svr.compressed"
|
// Add everything in the "dist" directory except for "svr.js" and "svr.compressed"
|
||||||
const distFilesAndDirectories = fs.existsSync(__dirname + "/dist")
|
archive.glob("**/*", {
|
||||||
? fs.readdirSync(__dirname + "/dist")
|
cwd: __dirname + "/dist",
|
||||||
: [];
|
ignore: [
|
||||||
distFilesAndDirectories.forEach((entry) => {
|
"svr.js",
|
||||||
if (entry == "svr.js" || entry == "svr.compressed") return;
|
"svr.compressed"
|
||||||
const stats = fs.statSync(__dirname + "/dist/" + entry);
|
],
|
||||||
if (stats.isDirectory()) {
|
dot: true
|
||||||
archive.directory(__dirname + "/dist/" + entry, entry);
|
|
||||||
} else if (stats.isFile()) {
|
|
||||||
archive.file(__dirname + "/dist/" + entry, { name: entry });
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// Create a stream for the "svr.compressed" file
|
// Create a stream for the "svr.compressed" file
|
||||||
|
|
Reference in a new issue