A basic Bun plugin designed to demonstrate how Abstract Syntax Trees (ASTs) work in JavaScript tooling. This project was created for educational purposes to accompany a YouTube tutorial on AST manipulation.
This plugin serves as a teaching tool to show:
- How plugins interact with the AST
- Visualizing AST structures
- Basic AST traversal and modification
- Basic example of AST transformations
- The role of ASTs in JavaScript bundlers
Meriyah transforms from JS to JS, not from TS to JS. For this you can use Bun's built-in transpiler: Bun.Transpile (But it has bugs with the import attributes)_.
To experiment with this plugin locally:
- Clone the repository:
git clone git@github.com:aralroca/import-hash-plugin.git
cd import-hash-plugin- Run the example:
bun run example.js[MIT] - Feel free to use this code for learning purposes.