Add debug flag to GDJS build script (#7771)

This commit is contained in:
Gleb Volkov
2025-08-08 14:17:26 +02:00
committed by GitHub
parent 5eeb505807
commit d75b4eb2a9
2 changed files with 25 additions and 1 deletions

View File

@@ -26,6 +26,28 @@ The game engine is in the _Runtime_ folder. If you want to work on the engine di
- To launch type checking with TypeScript, run `npm install` and `npm run check-types` in `GDJS` folder.
#### Building GDJS Runtime
To build the GDJS Runtime, run `npm run build` in the `GDJS` folder.
**Build Options:**
- **Production build (default)**: `npm run build` - builds with minification enabled
- **Debug build**: `npm run build -- --debug` - builds without minification for easier debugging
- **Custom output path**: `npm run build -- --out=/path/to/output` - specify custom output directory
**Examples:**
```bash
# Standard production build
npm run build
# Debug build for development (no minification)
npm run build -- --debug
# Debug build with custom output path
npm run build -- --debug --out=./debug-build
```
### GDJS Platform (exporters, code generation...)
Check the [GDJS Platform](https://docs.gdevelop.io/GDJS%20Documentation/index.html) documentation or the [full GDevelop developers documentation](https://docs.gdevelop.io/).

View File

@@ -7,6 +7,8 @@ const {
} = require('./lib/runtime-files-list');
const args = require('minimist')(process.argv.slice(2), {
string: ['out'],
boolean: ['debug'],
default: { debug: false }
});
const fs = require('fs').promises;
@@ -52,7 +54,7 @@ shell.mkdir('-p', bundledOutPath);
return build({
sourcemap: true,
entryPoints: [inPath],
minify: true,
minify: !args.debug,
outfile: renameBuiltFile(outPath),
}).catch(() => {
// Error is already logged by esbuild.