Skip to content

meh/rollup-plugin-rollup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

npm size

rollup-plugin-rollup

🍣 A Rollup plugin which imports a Rollup bundle as a string.

Requirements

This plugin requires an LTS Node version (v8.0.0+) and Rollup v1.20.0+.

Install

Using npm:

npm install rollup-plugin-rollup --save-dev

Usage

Assuming a src/index.js exists and contains code like the following:

import miner from './miner.rollup';
import { worker } from 'shumei';

worker.dedicated(miner);

And a src/miner.js exists and contains code like the following:

import { worker } from 'shumei';

const [tx, rx] = worker.channel();

for await (const msg of rx) {
  console.log(msg);
}

And a src/miner.rollup exists and contains code like the following:

import resolve from '@rollup/plugin-node-resolve';

export default {
  input: 'src/miner.js',
  plugins: [resolve()]
};

Create a rollup.config.js configuration file and import the plugin:

import rollup from 'rollup-plugin-rollup';

export default {
  input: 'src/index.js',
  output: {
    dir: 'output',
    format: 'cjs'
  },
  plugins: [rollup()]
};

Then call rollup either via the CLI or the API.

Options

No options at the moment.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published