Interop Question with raw HTML (not react)


Is it possible to include the compiled .bs.js directly into an HTML file ?
That is I’ll put the file

<script src=""></script>

in the html file and it just works


That’s generally possible, yes. If you’re using more than one module though, you probably want to bundle your files with parcel or webpack (or something similar).


You’re going to want a bundler regardless. Simple partial application on a curried function will force the inclusion of:

var Curry = require("bs-platform/lib/js/curry.js");

which the browser can’t handle; using the Belt and Js libraries will have a similar effect.

For an introduction to bundling see: Modern JavaScript Explained For Dinosaurs