forked from svrjs/svrjs
Make the build script not pack two "svr.js" files in the zip file.
This commit is contained in:
parent
6f6fb1f89f
commit
8de05d87b5
1 changed files with 14 additions and 1 deletions
|
@ -214,7 +214,20 @@ esbuild
|
||||||
zlib: { level: 9 },
|
zlib: { level: 9 },
|
||||||
});
|
});
|
||||||
archive.pipe(output);
|
archive.pipe(output);
|
||||||
archive.directory(__dirname + "/dist/", false);
|
|
||||||
|
// Add everything in the "dist" directory except for "svr.js" and "svr.compressed"
|
||||||
|
const distFilesAndDirectories = fs.existsSync(__dirname + "/dist")
|
||||||
|
? fs.readdirSync(__dirname + "/dist")
|
||||||
|
: [];
|
||||||
|
distFilesAndDirectories.forEach((entry) => {
|
||||||
|
if (entry == "svr.js" || entry == "svr.compressed") return;
|
||||||
|
const stats = fs.statSync(__dirname + "/dist/" + entry);
|
||||||
|
if (stats.isDirectory()) {
|
||||||
|
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
|
||||||
const compressedSVRJSFileStream = fs
|
const compressedSVRJSFileStream = fs
|
||||||
|
|
Reference in a new issue