Sorry for the (probably) silly question; I am trying to cut my teeth with PureScript building a very simple application.
I have managed to create a simple project that compile correctly, but when I try to load the bundled script in the browser I get the “Can’t find variable: require” error.
I’d guess it’s referring to the function ‘require’ which implements the CommonJS module system. The web browser doesn’t implement that module system, so you need to preprocess your code to remove those. Webpack and Rollup and Parcel all do that. I heard Parcel is the easiest because it has reasonable defaults and heuristics. I don’t have a link to an example project right now, but I know there are some on GitHub that include this preprocess step in their build script (maybe defined in package.json or similar) that might help you get started with that.
This is also relevant, but I’m not sure if it still works:
I confirm that post-processing the index.html file with Parcel fix my problem.
I now have to sort out how to wrap everything nicely into the project structure, but at least I know which way to dig; thanks @chexxor.