Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/N1kto/rollup-plugin-coffee-react
Rollup plugin to transpile .coffee and .cjsx files
https://github.com/N1kto/rollup-plugin-coffee-react
Last synced: 25 days ago
JSON representation
Rollup plugin to transpile .coffee and .cjsx files
- Host: GitHub
- URL: https://github.com/N1kto/rollup-plugin-coffee-react
- Owner: N1kto
- Created: 2016-07-08T08:48:39.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-07-22T14:33:42.000Z (over 8 years ago)
- Last Synced: 2024-10-31T19:59:13.176Z (about 1 month ago)
- Language: JavaScript
- Size: 5.86 KB
- Stars: 7
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome - coffee-react - Compile CJSX and CoffeeScript. (Plugins / Transpilation)
README
# Rollup Coffee React Plugin
Basically this is a simple wrapper around [coffee-react-transform](https://github.com/jsdf/coffee-react-transform).
It enables rollup to bundle your `.cjsx` files.
It also transpiles regular `.coffee` files.## Usage
Install it with `npm install rollup-plugin-coffee-react`
Then in your `rollup.config.js`:
```js
import coffeeReact from 'rollup-plugin-coffee-react'export default {
dest: 'build/app.js',
entry: 'src/index.js',
plugins: [
coffeeReact({
exclude: 'node_modules/**'
})
]
}
```## Usage with other rollup plugins
Since `coffee-script` compiles into ES5 code, you'll use this plugin in tandem with [commonjs](https://github.com/rollup/rollup-plugin-commonjs) and [node-resolve](https://github.com/rollup/rollup-plugin-node-resolve) plugins.
Just don't forget to add `.coffee`, `.cjsx` to mentioned plugins' `extensions` option. For example:```js
import coffeeReact from 'rollup-plugin-coffee-react'
import commonjs from 'rollup-plugin-commonjs'export default {
dest: 'build/app.js',
entry: 'src/index.js',
plugins: [
coffeeReact({
exclude: 'node_modules/**'
}),
nodeResolve({
main: true,
browser: true,
extensions: [ '.js', '.coffee', '.csjx' ]
}),
commonjs({
extensions: [ '.js', '.coffee', '.cjsx' ]
})
]
}
```## Options
Rollup's `include`, `exclude` plugin options are supported.
You can also pass options for `coffee-script` to configure `coffee -> js` transpiling. Please refer to [coffee-script](https://github.com/jashkenas/coffeescript) documentation for details.