# rollup-plugin-import-extendscript

> import .jsx extendscript files as a string for later evaluation using evalScript()

Latest version **1.1.2** (published 2024-09-01) · 0 weekly downloads

## Install

```sh
npm install rollup-plugin-import-extendscript
pnpm add rollup-plugin-import-extendscript
yarn add rollup-plugin-import-extendscript
bun add rollup-plugin-import-extendscript
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.2 |
| Published | 2024-09-01 |
| First published | 2023-03-10 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | ESM |
| Dependencies | 6 |
| Unpacked size | 26.7 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Good Boy Ninja |
| Maintainers | goodboyninja |
| Keywords | adobe, extendscript, jsx |

## Links

- npm: https://www.npmjs.com/package/rollup-plugin-import-extendscript
- Repository: https://github.com/GoodBoyNinja/rollup-plugin-bundle-extendscript
- Homepage: https://github.com/GoodBoyNinja/rollup-plugin-bundle-extendscript#readme
- Issues: https://github.com/GoodBoyNinja/rollup-plugin-bundle-extendscript/issues
- npm.io page: https://npm.io/package/rollup-plugin-import-extendscript

## Dependencies (6)

- [uuid](https://npm.io/package/uuid.md) ^9.0.0
- [jsesc](https://npm.io/package/jsesc.md) ^3.0.2
- [@types/jsesc](https://npm.io/package/@types/jsesc.md) ^3.0.3
- [code-stringify](https://npm.io/package/code-stringify.md) ^2.0.3
- [recursive-readdir](https://npm.io/package/recursive-readdir.md) ^2.2.3
- [rollup-pluginutils](https://npm.io/package/rollup-pluginutils.md) ^2.8.2

## Recent versions

- 1.1.2 (latest) — 2024-09-01
- 1.1.1 — 2024-09-01
- 1.1.0 — 2024-09-01
- 1.0.9 — 2024-09-01
- 1.0.8 — 2024-09-01
- 1.0.7 — 2024-09-01
- 1.0.6 — 2024-09-01
- 1.0.5 — 2023-07-15
- 1.0.4 — 2023-04-28
- 1.0.3 — 2023-03-11
- 1.0.2 — 2023-03-10
- 1.0.1 — 2023-03-10
- 1.0.0 — 2023-03-10

## README

# rollup-plugin-import-extendscript
An experimental ___Vite / Rollup___ plugin to import ExtendScript files as a string


# Installation
```
npm install rollup-plugin-import-extendscript --dev
```

# Setup
When used with Vite, call the plugin in Vite's config instead of rollup's config to enjoy it during both development & bundling
```js
import { defineConfig } from 'vite';
import  importExtendScript  from 'rollup-plugin-import-extendscript';

export default defineConfig({
    plugins: [
        importExtendScript()
    ]
});
```


Rollup 
```js
import importExtendScript from 'rollup-plugin-import-extendscript';

export default {
  plugins: [
    importExtendScript()
  ]
};

```

# Usage
In your code, import the file as a string, then evaluate it
```js
import jsxContent from './jsx/file.jsx';
new CSInterface().evalScript(jsxContent);
```
The plugin will make sure that the file is loaded as a string, and that the string is properly escaped for ExtendScript.

# Options
## explicit
`.jsx` is not an extendscript exclusive file extension. To avoid clashes, you can set `explicit` to `true` and add a `?extendscript` suffix to your import statements. For example:

In your config file:
```js
importExtendScript({
    explicit: true
})
```

In your code:
```js
import jsxContent from './jsx/file.jsx?extendscript';
```
Files without the `?extendscript` suffix will be ignored by the plugin.


# Include
There are multiple ways to include a file in ExtendScript.
This plugin knows how to handle the following two:

```js
#include './other.jsx'
```

Or

```js
// @include './other.jsx'
```

<br><br> 

🎉<br>
Good Boy Ninja

---
_Source: https://npm.io/package/rollup-plugin-import-extendscript · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
