mirror of
https://github.com/danbulant/oxc
synced 2026-05-24 12:21:58 +00:00
``` > monitor-oxc@ test /home/runner/work/monitor-oxc/monitor-oxc > node src/main.test.mjs file:///home/runner/work/monitor-oxc/monitor-oxc/node_modules/.pnpm/inquirer@[10](https://github.com/oxc-project/monitor-oxc/actions/runs/10038139357/job/27739464680#step:8:11).0.1/node_modules/inquirer/dist/esm/ui/prompt.mjs:2 import { defer, EMPTY, from, of, concatMap, filter, reduce, isObservable, lastValueFrom } from "rxjs"; ^^^^^ SyntaxError: Named export 'EMPTY' not found. The requested module 'rxjs' is a CommonJS module, which may not support all module.exports as named exports. CommonJS modules can always be imported via the default export, for example using: import pkg from 'rxjs'; const { defer, EMPTY, from, of, concatMap, filter, reduce, isObservable, lastValueFrom } = pkg; at ModuleJob._instantiate (node:internal/modules/esm/module_job:134:21) at async ModuleJob.run (node:internal/modules/esm/module_job:217:5) at async ModuleLoader.import (node:internal/modules/esm/loader:316:24) at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:[12](https://github.com/oxc-project/monitor-oxc/actions/runs/10038139357/job/27739464680#step:8:13)3:5) Node.js v20.15.1 ``` Export is undefined when `enumerable` is "!0". See `https://github.com/nodejs/cjs-module-lexer/issues/64` |
||
|---|---|---|
| .. | ||
| examples | ||
| src | ||
| tests | ||
| Cargo.toml | ||
| CHANGELOG.md | ||
| README.md | ||
Minifier
A JavaScript minifier has three components:
- printer
- mangler
- compressor
Mangler
The mangler implementation is part of the SymbolTable residing in oxc_semantic.
It is responsible for shortening variables. Its algorithm should be gzip friendly.
The printer is also responsible for printing out the shortened variable names.
Compressor
The compressor is responsible for rewriting statements and expressions for minimal text output. Terser is a good place to start for learning the fundamentals.
Terser Tests
The fixtures are copied from https://github.com/terser/terser/tree/master/test/compress