I’m wondering how to bundle compiler v. 0.15.4 code built by Pulp (v. 16.0.2), for running in the browser. Obviously Pulp isn’t meant to work directly because it still uses CommonJS modules and I get an error to that effect if I try
pulp build --to ./html/Main.js.
This’s using a new Pulp project with
purescript-halogen installed using bower, and the code Counter example from the Halogen Guide. But the same problem occurs with any project I’ve tried.
esbuild --bundle output/Main/index.js --platform=browser --outfile="html/Main.js" does work, but the resulting code doesn’t do anything at all when called from the browser. I’ve also tried using
lebab on the output code, to no effect that I can see.
Pulp does build and run code which works fine in the REPL, it’s only when I try bundling it for the browser that it doesn’t work.
Thanks for your time.