Build your own bundler, two ways

Parse imports, build a dependency graph and emit one file: first as plain functions, then as a small compiler.

The procedural bundle logs my lord saber to the browser console. The layered bundle writes its greeting below. Both files sit next to this page in dist/.