rollup-plugin-reference-module

0.0.1 • Public • Published

rollup-plugin-reference-module

Get module reference, a url to the find bundled module, so you can use it in iframe or worker.

Usage

import someModuleURL from 'REF:./path/to/someModule';

// use it in worker
const worker = new Worker(someModuleURL);

// inject is into iframe
const iframeDoc = document.getElementById('iframe').contentDocument;
const script = iframeDoc.createElement('script');
script.src = someModuleURL;
iframeDoc.body.append(script);

Readme

Keywords

none

Package Sidebar

Install

npm i rollup-plugin-reference-module

Weekly Downloads

3

Version

0.0.1

License

Apache-2.0

Unpacked Size

4.8 kB

Total Files

5

Last publish

Collaborators

  • markduannnn