Compare commits

..

1 Commits

Author SHA1 Message Date
AncTe
8a3087a762
Merge f496175bb2 into 820dc5bf4c 2025-10-21 14:00:54 +00:00
2 changed files with 7 additions and 25 deletions

View File

@ -572,21 +572,13 @@ async function buildGame() {
) )
); );
const scripts = archiver('zip', { const scripts = archiver('zip');
store: false, scripts.directory('packages/', resolve(process.cwd(), 'packages'));
zlib: {
level: 9
}
});
scripts.directory(resolve(process.cwd(), 'packages'), 'packages/');
scripts.directory( scripts.directory(
resolve(process.cwd(), 'packages-user'), 'packages-user/',
'packages-user/' resolve(process.cwd(), 'packages-user')
); );
scripts.directory(resolve(process.cwd(), 'src'), '/src'); scripts.directory('src/', resolve(process.cwd(), 'src'));
scripts.file(resolve(process.cwd(), 'public', 'main.js'), {
name: 'main.js'
});
const output = createWriteStream(resolve(distDir, 'source-code.zip')); const output = createWriteStream(resolve(distDir, 'source-code.zip'));
scripts.pipe(output); scripts.pipe(output);
@ -634,11 +626,7 @@ async function buildGame() {
try { try {
await zip.compressDir( await zip.compressDir(
resolve(distDir), resolve(distDir),
resolve(process.cwd(), 'dist.zip'), resolve(process.cwd(), 'dist.zip')
{
compress: true,
compressionLevel: 9
}
); );
await emptyDir(tempDir); await emptyDir(tempDir);

View File

@ -67,13 +67,7 @@ async function compressFiles(files: ResourceContent[]) {
const dir = `${v.type}/${v.name}`; const dir = `${v.type}/${v.name}`;
zip.file(dir, v.content); zip.file(dir, v.content);
}); });
const buffer = await zip.generateAsync({ const buffer = await zip.generateAsync({ type: 'uint8array' });
type: 'uint8array',
compression: 'DEFLATE',
compressionOptions: {
level: 9
}
});
const hash = fileHash(buffer); const hash = fileHash(buffer);
const name = `resource.${hash}.h5data`; const name = `resource.${hash}.h5data`;