Preparing for system design interviews?  Try bugzed.com →

babel-plugin-transform-dirname-filename

JSON →
library 1.1.0 ·javascript
verified Jun 17, 2026

Babel plugin (v1.1.0) that rewrites __dirname and __filename to static values at compile time, preserving original source file paths in bundled output. Stable, no recent updates since 2022. Different from other solutions (e.g., webpack.DefinePlugin) as it works specifically with Babel for transpilation, ensuring that after bundling, __dirname and __filename reflect the source file location rather than the output directory. Suitable for Node.js packages distributed as compiled code.

total hits 12
actors 4 distinct systems
last hit 18d ago AhrefsBot
GPTBot
4
ByteDance
3
Script
1

top countries 🇺🇸 United States · 🇸🇬 Singapore · 🇨🇦 Canada · 🇬🇧 United Kingdom · 🇩🇪 Germany