You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
+
importafterEffectJsxfrom'./rollup-plugin-ae-jsx';
31
+
32
+
exportdefault {
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.
0 commit comments