A rollup plugin helps create a Scriptable bundle from your project by automating manifest and comment generation.
To install the plugin, use npm or pnpm:
npm install rollup-plugin-scriptable --save-dev
# or
pnpm add rollup-plugin-scriptable --dev
Add the plugin to your rollup.config.js
:
import bundle from 'rollup-plugin-scriptable';
export default {
input: 'src/index.js',
output: {
file: 'dist/bundle.js',
format: 'es',
},
plugins: [bundle()],
// or customize the manifest file extension
// plugins: [bundle({ manifest: mockManifest, bundleManifest: { extension: '.json' } })],
};
The plugin accepts the following options:
-
manifest
: An object representing the manifest data. -
bundleManifest
: A boolean or object to configure manifest bundling. Default istrue
.-
extension
: The file extension for the manifest file. Default is.manifest.json
.
-
import bundle from 'rollup-plugin-scriptable';
const mockManifest = {
name: 'Example Script',
version: '1.0.0',
};
export default {
input: 'src/index.js',
output: {
file: 'dist/bundle.js',
format: 'es',
},
// disable manifest bundling
plugins: [bundle({manifest: mockManifest, bundleManifest: false})],
};
Portions of code and functionality are referenced from the rollup-plugin-scriptable project. Many thanks!
This project is licensed under the Apache-2.0 License.