ES module version of compiler for use in browsers; dynamic import() docs; revised Stage 3 policy by GeoffreyBooth · Pull Request #5177 · jashkenas/coffeescript
I started writing the docs for dynamic import (#5169) and I wanted to include a runnable example. There aren’t too many ES module scripts available for use out on the Web, and I wanted one where there wasn’t magic or rewriting going on like sometimes happens at Pika or unpkg, so I decided to create an alternate build of the CoffeeScript browser-based compiler that works as an ES module.
So now in the package.json there’s a "module" field that points to a version of the CoffeeScript compiler that uses an export statement to provide the browser compiler’s public API to anyone who wants to consume it in a browser <script type="module"> environment. When support for ES modules comes to Node, I’ll create an ES module build for use in Node as well.
See the new ES module CoffeeScript compiler in action:
https://coffeescript.org/#modules (in the Modules section, scroll down to the second example)
Besides that, this PR includes docs for import() and an update to the Contributing section amending our policy on new features to allow Stage 3 features that have been released in major browsers and/or Node (with the caveat that they should be considered experimental until the features reach Stage 4).