mirror of
https://github.com/oxc-project/oxc.git
synced 2026-09-14 19:36:11 +08:00
ea2880170a
Add benchmarks for source maps in `oxc-codegen`. 2 benchmarks: 1. Full end-to-end. 2. Without the actual sourcemap generation at the end. The 2nd is to measure the overhead that pushing to the sourcemap arrays adds while printing in isolation.
21 lines
947 B
TypeScript
21 lines
947 B
TypeScript
// Global constants defined at build time by TSDown.
|
|
|
|
// `true` if build emits source maps
|
|
declare const SOURCEMAPS: boolean;
|
|
|
|
// `true` if build supports TypeScript syntax.
|
|
// In builds where it's `false`, `tsdown_plugins/strip_ts.ts` also removes the switch arms
|
|
// fenced with `/* IF TS */` / `/* END_IF */` comments.
|
|
declare const TS: boolean;
|
|
|
|
// `true` if is debug build.
|
|
// Built with `pnpm run build-dev`, which sets `DEBUG=true`. Debug builds keep `debugAssert` calls
|
|
// (see `src/asserts.ts`). Release builds strip them in `tsdown_plugins/remove_asserts.ts`.
|
|
declare const DEBUG: boolean;
|
|
|
|
// `true` if is benchmark build.
|
|
// Built with `pnpm run bench`, which sets `BENCHMARKS=true`. Benchmark builds honor the
|
|
// `skipSourcemapGeneration` option, so a benchmark can measure the print pass without the final
|
|
// source map generation. In normal builds the option does nothing and the check folds away.
|
|
declare const BENCHMARKS: boolean;
|