Skip to content

Commit 797fe64

Browse files
authored
Update README.md
1 parent cbdd621 commit 797fe64

File tree

1 file changed

+59
-1
lines changed

1 file changed

+59
-1
lines changed

README.md

Lines changed: 59 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,60 @@
1+
[npm]: https://img.shields.io/npm/v/timhaywood/rollup-plugin-ae-jsx
2+
[npm-url]: https://www.npmjs.com/package/timhaywood/rollup-plugin-ae-jsx
3+
[size]: https://packagephobia.now.sh/badge?p=timhaywood/rollup-plugin-ae-jsx
4+
[size-url]: https://packagephobia.now.sh/result?ptimhaywood/rollup-plugin-ae-jsx
5+
6+
[![npm][npm]][npm-url]
7+
[![size][size]][size-url]
8+
19
# rollup-plugin-ae-jsx
2-
RollupJS plugin to turn output into After Effects compatible .jsx JSON files
10+
11+
A Rollup plugin which converts the ouput to After Effects compatible JSON for `.jsx` files.
12+
13+
## Requirements
14+
15+
This plugin requires an [LTS](https://github.com/nodejs/Release) Node version (v8.0.0+) and Rollup v1.20.0+.
16+
17+
## Install
18+
19+
Using npm:
20+
21+
```console
22+
npm install rollup-plugin-ae-jsx --save-dev
23+
```
24+
25+
## Usage
26+
27+
Create a `rollup.config.js` [configuration file](https://www.rollupjs.org/guide/en/#configuration-files), import the plugin, and add it to the `plugins` array:
28+
29+
```js
30+
import afterEffectJsx from './rollup-plugin-ae-jsx';
31+
32+
export default {
33+
input: 'src/index.js',
34+
output: {
35+
file: 'dist/index.jsx',
36+
format: 'cjs'
37+
},
38+
plugins: [
39+
afterEffectsJsx()
40+
]
41+
};
42+
```
43+
44+
> The output extension should be `.jsx` and format `cjs` to ensure After Effects compatible files.
45+
46+
Then call `rollup` either via the [CLI](https://www.rollupjs.org/guide/en/#command-line-reference) or the [API](https://www.rollupjs.org/guide/en/#javascript-api).
47+
48+
`rollup-plugin-ae-jsx` should be placed in `plugins` _after_ any other plugins.
49+
50+
## Limitations
51+
52+
Since After Effects compatible JSON isn't valid JavaScript, transformations must be done on the output code as a string rather than the AST. This means success is dependant on the formatting of the code.
53+
54+
While not perfect, it works well enough for our use, but errors may occur adapting it to work with your own code.
55+
56+
## Meta
57+
58+
[CONTRIBUTING](/.github/CONTRIBUTING.md)
59+
60+
[LICENSE (MIT)](/LICENSE)

0 commit comments

Comments
 (0)