CoffeeScript
CoffeeScript is a language that transpiles to JavaScript, which allows you to use a shorter syntax and other features like the existential operator, shorter array-splicing syntax, block regular expressions and more.
Parcel supports CoffeeScript using the @parcel/transformer-coffeescript plugin. To use it, install it into your app and add it to your .parcelrc.
yarn add @parcel/transformer-coffeescript@next --dev
.parcelrc:
{
"extends": "@parcel/config-default",
"transformers": {
"*.coffee": ["@parcel/transformer-coffeescript"]
}
}
CoffeeScript is compiled to JavaScript and processed as described in the JavaScript docs.
Example usage
#index.html:
<script type="module" src="app.coffee"></script>
app.coffee:
console.log 'Hello world!'