0.0.1 • Published 2 years ago

rollup-plugin-reference-module v0.0.1

Weekly downloads
-
License
Apache-2.0
Repository
-
Last release
2 years ago

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);
0.0.1

2 years ago