@scriptables/rollup-plugin-scriptable
v0.7.0
Published
A rollup plugin helps create a Scriptable bundle from your project by automating metadata and comment generation.
Downloads
505
Readme
@scriptables/rollup-plugin-scriptable
A rollup plugin helps create a Scriptable bundle from your project by automating manifest and comment generation.
Installation
To install the plugin, use npm or pnpm:
npm install rollup-plugin-scriptable --save-dev
# or
pnpm add rollup-plugin-scriptable --dev
Usage
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' } })],
};
Options
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
.
Example
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})],
};
Acknowledgements
Portions of code and functionality are referenced from the rollup-plugin-scriptable project. Many thanks!
License
This project is licensed under the Apache-2.0 License.