@mnrendra/rollup-utils
v1.1.0
Published
Rollup plugin utilities.
Downloads
17
Readme
@mnrendra/rollup-utils
🍣 Rollup plugin utilities.
Install
npm i @mnrendra/rollup-utils
Usage
yourPlugin/index.ts
import type { Plugin } from 'rollup'
import { initStore, printInfo } from '@mnrendra/rollup-utils'
import store from './store'
/**
* Rollup plugin.
*
* @returns {Promise<Plugin>} Rollup plugin object.
*/
const main = async (): Promise<Plugin> => {
// Initialize store.
await initStore(store)
// Print info.
await printInfo(store)
// Return Rollup plugin object.
return {
/**
* Rollup properties
*/
name: store.pluginName,
version: store.version
}
}
export default main
yourPlugin/store.ts
import type { Store } from '@mnrendra/rollup-utils'
const store: Store = {
pluginName: 'your-plugin-name',
name: 'your-module-name',
version: 'your-module-version',
homepage: 'your-module-homepage'
}
export default store
Utilities
• initStore
To initialize the store to save the plugin package data.
• printInfo
To print Rollup plugin info from the store.
Types
• Store
Store interface.