mirror of
https://github.com/oven-sh/bun
synced 2026-02-12 11:59:00 +00:00
In CommonJS format, import.meta and import.meta.url need to be
transformed into valid CJS equivalents:
- import.meta -> {url: require('url').pathToFileURL(__filename).href}
- import.meta.url -> require('url').pathToFileURL(__filename).href
This change updates js_printer.zig to handle these transformations
when module_type is .cjs. The ESM format remains unchanged.
Added comprehensive tests to verify the transformation works correctly.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>