1.1.2 • Published 10 months ago

rollup-plugin-import-extendscript v1.1.2

Weekly downloads
-
License
-
Repository
github
Last release
10 months ago

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

import { defineConfig } from 'vite';
import  importExtendScript  from 'rollup-plugin-import-extendscript';

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

Rollup

import importExtendScript from 'rollup-plugin-import-extendscript';

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

Usage

In your code, import the file as a string, then evaluate it

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:

importExtendScript({
    explicit: true
})

In your code:

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:

#include './other.jsx'

Or

// @include './other.jsx'

šŸŽ‰ Good Boy Ninja

1.1.1

10 months ago

1.1.0

10 months ago

1.0.9

10 months ago

1.0.8

10 months ago

1.0.7

10 months ago

1.0.6

10 months ago

1.1.2

10 months ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago