Interop Question with raw HTML (not react)


#1

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

<script src="Abc.bs.js"></script>

in the html file and it just works


#2

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).


#3

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