@@ -12,24 +12,31 @@ const tc = require("./template-common");
1212
1313const extraArgs = "" ;
1414
15- // @ts -expect-error we are touching global
16- const targetArgs = global . NO_TARGET_ARGS
15+ /**
16+ * @typedef {object } GlobalObj
17+ * @property {boolean= } NO_TARGET_ARGS no target args flag
18+ * @property {boolean= } NO_REASONS no stats reasons flag
19+ * @property {boolean= } NO_STATS_OPTIONS no stats options flag
20+ * @property {boolean= } NO_PUBLIC_PATH no public path flag
21+ * @property {boolean= } STATS_COLORS no stats color flag
22+ */
23+
24+ const globalObj = /** @type {typeof globalThis & GlobalObj } */ ( global ) ;
25+
26+ const targetArgs = globalObj
1727 ? ""
1828 : "--entry ./example.js --output-filename output.js" ;
19- // @ts -expect-error we are touching global
20- const displayReasons = global . NO_REASONS
29+ const displayReasons = globalObj
2130 ? ""
2231 : "--stats-reasons --stats-used-exports --stats-provided-exports" ;
23- // @ts -expect-error we are touching global
24- const statsArgs = global . NO_STATS_OPTIONS
32+ const statsArgs = globalObj
2533 ? ""
2634 : "--stats-chunks --stats-modules-space 99999 --stats-chunk-origins" ;
27- // @ts -expect-error we are touching global
28- const publicPathArgs = global . NO_PUBLIC_PATH
35+ const publicPathArgs = globalObj . NO_PUBLIC_PATH
2936 ? ""
3037 : '--output-public-path "dist/"' ;
31- // @ts -expect-error we are touching global
32- const statsColorsArg = global . STATS_COLORS ? "" : "--no-color" ;
38+ const statsColorsArg = globalObj . STATS_COLORS ? "" : "--no-color" ;
39+
3340const commonArgs = `${ statsColorsArg } ${ statsArgs } ${ publicPathArgs } ${ extraArgs } ${ targetArgs } ` ;
3441
3542let readme = fs . readFileSync (
0 commit comments