mirror of
https://github.com/4ian/GDevelop.git
synced 2026-10-12 02:01:17 +00:00
@@ -21,17 +21,34 @@ const checkLibGDjsSize = () => {
|
||||
shell.exit(1);
|
||||
}
|
||||
|
||||
const sizeInMiB = stats.size / 1024 / 1024;
|
||||
if (sizeInMiB > 2) {
|
||||
// A release build is minified into a handful of very long lines, while a
|
||||
// 'dev' or 'debug' build is not minified at all (tens of thousands of lines).
|
||||
// Their sizes are too close to tell them apart, so check the line count.
|
||||
const lineCount = fs
|
||||
.readFileSync(path.join(appPublicPath, 'libGD.js'), 'utf8')
|
||||
.split('\n').length;
|
||||
if (lineCount > 1000) {
|
||||
shell.echo(
|
||||
`❌ libGD.js size is too big (${sizeInMiB.toFixed(
|
||||
2
|
||||
)}MiB) - are you sure you're not trying to deploy the development version?`
|
||||
`❌ libGD.js does not look minified (${lineCount} lines) - are you sure you're not trying to deploy the development version?`
|
||||
);
|
||||
shell.exit(1);
|
||||
}
|
||||
|
||||
shell.echo(`✅ libGD.js size seems correct (${sizeInMiB.toFixed(2)}MiB)`);
|
||||
const sizeInMiB = stats.size / 1024 / 1024;
|
||||
if (sizeInMiB > 4) {
|
||||
shell.echo(
|
||||
`❌ libGD.js size is too big (${sizeInMiB.toFixed(
|
||||
2
|
||||
)}MiB) - are you sure it was built properly?`
|
||||
);
|
||||
shell.exit(1);
|
||||
}
|
||||
|
||||
shell.echo(
|
||||
`✅ libGD.js seems correct (${sizeInMiB.toFixed(
|
||||
2
|
||||
)}MiB, ${lineCount} lines)`
|
||||
);
|
||||
|
||||
if (!fs.existsSync(path.join(appPublicPath, 'libGD.wasm'))) {
|
||||
shell.echo(
|
||||
|
||||
@@ -42,18 +42,33 @@ isGitClean()
|
||||
shell.exit(1);
|
||||
}
|
||||
|
||||
// A release build is minified into a handful of very long lines, while a
|
||||
// 'dev' or 'debug' build is not minified at all (tens of thousands of lines).
|
||||
// Their sizes are too close to tell them apart, so check the line count.
|
||||
const lineCount = fs
|
||||
.readFileSync(path.join(appPublicPath, 'libGD.js'), 'utf8')
|
||||
.split('\n').length;
|
||||
if (lineCount > 1000) {
|
||||
shell.echo(
|
||||
`❌ libGD.js does not look minified (${lineCount} lines) - are you sure you're not trying to deploy the development version?`
|
||||
);
|
||||
shell.exit(1);
|
||||
}
|
||||
|
||||
const sizeInMiB = stats.size / 1024 / 1024;
|
||||
if (sizeInMiB > 2) {
|
||||
if (sizeInMiB > 4) {
|
||||
shell.echo(
|
||||
`❌ libGD.js size is too big (${sizeInMiB.toFixed(
|
||||
2
|
||||
)}MiB) - are you sure you're not trying to deploy the development version?`
|
||||
)}MiB) - are you sure it was built properly?`
|
||||
);
|
||||
shell.exit(1);
|
||||
}
|
||||
|
||||
shell.echo(
|
||||
`✅ libGD.js size seems correct (${sizeInMiB.toFixed(2)}MiB)`
|
||||
`✅ libGD.js seems correct (${sizeInMiB.toFixed(
|
||||
2
|
||||
)}MiB, ${lineCount} lines)`
|
||||
);
|
||||
|
||||
if (!fs.existsSync(path.join(appPublicPath, 'libGD.wasm'))) {
|
||||
|
||||
Reference in New Issue
Block a user