Back to results
meh/rollup-plugin-rollup(opens in a new tab)
Language: JavaScript
- stars
- 0
- watchers
- 1
- forks
- 0
- open issues
- 0
- Last updated
- 10/24/2020
Language: JavaScript
🍣 A Rollup plugin which imports a Rollup bundle as a string.
This plugin requires an LTS Node version (v8.0.0+) and Rollup v1.20.0+.
Using npm:
npm install rollup-plugin-rollup --save-devAssuming 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.
No options at the moment.