Registry / devops / esbuild-coffeescript-rails

esbuild-coffeescript-rails

JSON →
library2.2.2jsnpmunverified

An esbuild plugin for importing CoffeeScript and Literate CoffeeScript (.litcoffee) files, designed to integrate with Rails Sprockets. The current stable version is 2.2.2. The plugin compiles CoffeeScript to JavaScript using the coffeescript compiler, supporting options like source maps, bare mode, and Babel transpilation. It is actively maintained and provides TypeScript definitions. This plugin is a niche tool for legacy or existing CoffeeScript projects that want to use esbuild as their bundler, offering a straightforward API and compatibility with the Rails asset pipeline.

devops
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

ESM default export; CommonJS require returns the plugin function directly.

import coffeeScriptPlugin from 'esbuild-coffeescript-rails'

CommonJS require gives the plugin function as the default, not as a named export.

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

TypeScript type import for configuration options; available since TypeScript types are shipped.

import type { CoffeeScriptOptions } from 'esbuild-coffeescript-rails'

Demonstrates using the plugin with esbuild to bundle a CoffeeScript entry point.

// build.js const coffeeScriptPlugin = require('esbuild-coffeescript-rails'); require('esbuild').build({ entryPoints: ['main.coffee'], bundle: true, outfile: 'out.js', plugins: [coffeeScriptPlugin()], });
Debug
Known footguns
breakingVersion 2.x changed the export to not require .default in CommonJS.
deprecatedThe `header` option is deprecated in CoffeeScript 2+ and may be removed.
gotchaThe plugin does not support JSX or TypeScript; those must be handled by other esbuild plugins.
gotchaSource maps generated by CoffeeScript may not be fully compatible with esbuild's pipeline; consider using `inlineMap` option.
breakingDropped support for Node.js versions <12 in version 2.x.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
8 hits · last 30 days
gptbot
3
ahrefsbot
2
Resources