1.1.0 • Published 1 year ago

@mnrendra/rollup-utils v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

@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.

License

MIT

Author

@mnrendra

1.1.0

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago