Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/johnie/esbuild-coffeescript
https://github.com/johnie/esbuild-coffeescript
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/johnie/esbuild-coffeescript
- Owner: johnie
- Created: 2021-05-02T10:05:09.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2024-11-16T20:43:34.000Z (3 months ago)
- Last Synced: 2024-11-18T04:35:37.623Z (3 months ago)
- Language: JavaScript
- Homepage:
- Size: 55.7 KB
- Stars: 23
- Watchers: 4
- Forks: 4
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
- awesome-esbuild - esbuild-coffeescript
README
# esbuild-coffeescript
[![esbuild-coffeescript](https://github.com/johnie/esbuild-coffeescript/actions/workflows/master.yml/badge.svg?branch=master)](https://github.com/johnie/esbuild-coffeescript/actions/workflows/master.yml)
> This plugin lets you import [CoffeeScript](https://coffeescript.org/) files when bundling with [Esbuild](https://esbuild.github.io/)
## Installation
```
$ npm install --save-dev esbuild-coffeescript
```## Getting Started
`main.coffee`
```coffee
answer = 42
console.log("the answer is #{answer}")
````build.js`
```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`
```js
coffeeScriptPlugin({
bare: true,
});
```The following options are available:
- `options.inlineMap`, `boolean`: if true, output the source map as a base64-encoded string in a comment at the bottom.
- `options.filename`, `string`: the filename to use for the source map. It can include a path (relative or absolute).
- `options.bare`, `boolean`: if true, output without the top-level function safety wrapper.
- `options.header`, `boolean`: if true, output the Generated by CoffeeScript header.
- `options.transpile`, `object`: if set, this must be an object with the options to pass to Babel. See [Transpilation](https://coffeescript.org/#transpilation).
- `options.ast`, `boolean`: if true, return an abstract syntax tree of the input CoffeeScript source code.### 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.