Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lautis/rollup-plugin-coffee-script
Integration between Rollup and CoffeeScript.
https://github.com/lautis/rollup-plugin-coffee-script
Last synced: about 1 month ago
JSON representation
Integration between Rollup and CoffeeScript.
- Host: GitHub
- URL: https://github.com/lautis/rollup-plugin-coffee-script
- Owner: lautis
- License: mit
- Created: 2015-12-28T03:57:58.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2019-06-19T16:20:02.000Z (over 5 years ago)
- Last Synced: 2024-09-15T03:41:01.094Z (3 months ago)
- Language: JavaScript
- Size: 22.5 KB
- Stars: 22
- Watchers: 2
- Forks: 6
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
- awesome - coffee-script
README
# rollup-plugin-coffee-script
[![Build Status](https://travis-ci.org/lautis/rollup-plugin-coffee-script.svg?branch=master)](https://travis-ci.org/lautis/rollup-plugin-coffee-script)Integration between Rollup and CoffeeScript 2.
## Why?
Allow CoffeeScript code to be included in Rollup bundles without introducing an
additional build step.## Installation
```bash
npm install --save-dev rollup-plugin-coffee-script
# or
yarn add -D rollup-plugin-coffee-script
```## Usage
```js
// rollup.config.js
import coffeescript from 'rollup-plugin-coffee-script';export default {
input: 'main.coffee',plugins: [
coffeescript()
]
}
```CoffeeScript plugin accepts `options.include` and `options.exclude` (each a
minimatch pattern, or array of minimatch patterns) to determine which files are
compiled by CoffeeScript. By default, all files are transpiled.## Integration with CommonJS modules
The CoffeeScript plugin doesn't resolve requires. Instead,
use `rollup-plugin-commonjs` and add `.coffee` to extensions.```js
import commonjs from 'rollup-plugin-commonjs';
import coffee from 'rollup-plugin-coffee-script';
import nodeResolve from 'rollup-plugin-node-resolve';export default {
input: 'main.coffee',
plugins: [
coffee(),
nodeResolve({ extensions: ['.js', '.coffee'] }),
commonjs({
extensions: ['.js', '.coffee']
})
]
}
```