@gjsify/cli 0.3.19 → 0.3.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/config.js CHANGED
@@ -230,10 +230,25 @@ export class Config {
230
230
  // CLI flag wins over config; if neither is set, minify by default.
231
231
  // Pretty-printed output is opt-in via `--no-minify` or
232
232
  // `bundler.output.minify: false` in the config.
233
+ //
234
+ // When minify is enabled (boolean true) we expand it to a MinifyOptions
235
+ // object that PRESERVES function and class .name properties. Rolldown's
236
+ // default mangler renames every top-level class to short identifiers
237
+ // (`e`, `t`, ...), which collapses Function.name → 'e' for many
238
+ // distinct classes. Libraries like Excalibur key runtime data
239
+ // structures off `c.name` (e.g. `Query.createId` hashes
240
+ // `c_${component.name}` to dedupe ECS queries), so once class names
241
+ // collide every query with N components is treated as identical and
242
+ // the wrong filter wins. Keeping the .name property only costs a few
243
+ // bytes per class but keeps name-driven library code working
244
+ // (Excalibur ECS, deepkit reflection, error stacks, etc.).
233
245
  if (cliArgs.minify !== undefined)
234
246
  output.minify = cliArgs.minify;
235
247
  if (output.minify === undefined)
236
248
  output.minify = true;
249
+ if (output.minify === true) {
250
+ output.minify = { mangle: { keepNames: { function: true, class: true } } };
251
+ }
237
252
  if (cliArgs.logLevel) {
238
253
  // Map esbuild log levels to Rolldown's narrower set:
239
254
  // esbuild → rolldown
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gjsify/cli",
3
- "version": "0.3.19",
3
+ "version": "0.3.21",
4
4
  "description": "CLI for Gjsify",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
@@ -23,15 +23,15 @@
23
23
  "cli"
24
24
  ],
25
25
  "dependencies": {
26
- "@gjsify/create-app": "^0.3.19",
27
- "@gjsify/node-polyfills": "^0.3.19",
28
- "@gjsify/npm-registry": "^0.3.19",
29
- "@gjsify/resolve-npm": "^0.3.19",
30
- "@gjsify/rolldown-plugin-gjsify": "^0.3.19",
31
- "@gjsify/rolldown-plugin-pnp": "^0.3.19",
32
- "@gjsify/semver": "^0.3.19",
33
- "@gjsify/tar": "^0.3.19",
34
- "@gjsify/web-polyfills": "^0.3.19",
26
+ "@gjsify/create-app": "^0.3.21",
27
+ "@gjsify/node-polyfills": "^0.3.21",
28
+ "@gjsify/npm-registry": "^0.3.21",
29
+ "@gjsify/resolve-npm": "^0.3.21",
30
+ "@gjsify/rolldown-plugin-gjsify": "^0.3.21",
31
+ "@gjsify/rolldown-plugin-pnp": "^0.3.21",
32
+ "@gjsify/semver": "^0.3.21",
33
+ "@gjsify/tar": "^0.3.21",
34
+ "@gjsify/web-polyfills": "^0.3.21",
35
35
  "cosmiconfig": "^9.0.1",
36
36
  "get-tsconfig": "^4.14.0",
37
37
  "pkg-types": "^2.3.1",
package/src/config.ts CHANGED
@@ -243,8 +243,23 @@ export class Config {
243
243
  // CLI flag wins over config; if neither is set, minify by default.
244
244
  // Pretty-printed output is opt-in via `--no-minify` or
245
245
  // `bundler.output.minify: false` in the config.
246
+ //
247
+ // When minify is enabled (boolean true) we expand it to a MinifyOptions
248
+ // object that PRESERVES function and class .name properties. Rolldown's
249
+ // default mangler renames every top-level class to short identifiers
250
+ // (`e`, `t`, ...), which collapses Function.name → 'e' for many
251
+ // distinct classes. Libraries like Excalibur key runtime data
252
+ // structures off `c.name` (e.g. `Query.createId` hashes
253
+ // `c_${component.name}` to dedupe ECS queries), so once class names
254
+ // collide every query with N components is treated as identical and
255
+ // the wrong filter wins. Keeping the .name property only costs a few
256
+ // bytes per class but keeps name-driven library code working
257
+ // (Excalibur ECS, deepkit reflection, error stacks, etc.).
246
258
  if (cliArgs.minify !== undefined) output.minify = cliArgs.minify;
247
259
  if (output.minify === undefined) output.minify = true;
260
+ if (output.minify === true) {
261
+ output.minify = { mangle: { keepNames: { function: true, class: true } } };
262
+ }
248
263
  if (cliArgs.logLevel) {
249
264
  // Map esbuild log levels to Rolldown's narrower set:
250
265
  // esbuild → rolldown