rollup-plugin-coffee-script
Integration between Rollup and CoffeeScript.
Last updated 3 years ago by lautis .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install rollup-plugin-coffee-script 
SYNC missed versions from official npm registry.

rollup-plugin-coffee-script

Build Status

Integration between Rollup and CoffeeScript 2.

Why?

Allow CoffeeScript code to be included in Rollup bundles without introducing an additional build step.

Installation

npm install --save-dev rollup-plugin-coffee-script

Usage

// 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.

import { rollup } from 'rollup';
import commonjs from 'rollup-plugin-commonjs';
import coffee from 'rollup-plugin-coffee-script';
import nodeResolve from 'rollup-plugin-node-resolve';

rollup({
  input: 'main.coffee',
  plugins: [
    coffee(),
    nodeResolve({ extensions: ['.js', '.coffee'] })
    commonjs({
      extensions: ['.js', '.coffee']
    })
  ]
}).then(...)

Current Tags

  • 2.0.0                                ...           latest (3 years ago)

4 Versions

  • 2.0.0                                ...           3 years ago
  • 1.1.0                                ...           4 years ago
  • 1.0.0                                ...           4 years ago
  • 0.1.0                                ...           5 years ago
Maintainers (1)
Downloads
Today 4
This Week 5
This Month 6
Last Day 1
Last Week 1
Last Month 6
Dependencies (3)
Dev Dependencies (7)

Copyright 2014 - 2017 © taobao.org |