I'm very proud of my hacky build script, but that doesn't make it a good thing, necessarily.
In fact, because of the assumptions the build script makes:
you have to ensure your code is requires everything first, declares any other variables second, and then exports last. This keeps the code consistent, but it's undesirable rigidity.
you can't name a variable the same as any other slapdash function (even across files). This one is more of a pain point.
On the upside, it does:
generate a smaller bundle than browserify or webpack (because there's no module interop layer)
run incredibly quickly (no parsing involved, just sketchy regex)
I'd be interested to see if we could use webpack (or rollup, or similar) to bundle it, and then cheekily strip out some of the webpack guff afterwards (or configure webpack to use more simple wrapping).
I'm very proud of my hacky build script, but that doesn't make it a good thing, necessarily.
In fact, because of the assumptions the build script makes:
On the upside, it does:
I'd be interested to see if we could use webpack (or rollup, or similar) to bundle it, and then cheekily strip out some of the webpack guff afterwards (or configure webpack to use more simple wrapping).