GitHub - johnie/esbuild-coffeescript (original) (raw)

esbuild-coffeescript

esbuild-coffeescript

This plugin lets you import CoffeeScript files when bundling with Esbuild

Installation

$ npm install --save-dev esbuild-coffeescript

Getting Started

main.coffee

answer = 42 console.log("the answer is #{answer}")

build.js

const coffeeScriptPlugin = require('esbuild-coffeescript');

require('esbuild').build({ entryPoints: ['main.coffee'], bundle: true, outfile: 'out.js', plugins: [coffeeScriptPlugin()], });

Configuration

An object containing configuration options may be passed into the plugin constructor coffeeScriptPlugin

coffeeScriptPlugin({ bare: true, });

The following options are available:

But CoffeeScript is dead?

While it might seem like it, coffeescript is still downloaded over 1.6 million times every week. Coffeescript is still actively used and widespread, and this plugin provides a great way for these projects to leverage the great esbuild tooling.