eight04 / rollup-plugin-iife

Convert ES modules into IIFEs.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Import polyfillImport() from a module?

eight04 opened this issue · comments

commented

Currently, dynamicImport is just a global variable name. Users have to prepare an external global helper outside of the bundle. Is it possible to build the helper into the bundle? For example:

import("./foo.js").then(console.log);

transform

import _import_polyfill_ from "myImportPolyfill";
_import_polyfill_("./foo.js", import.meta.url).then(console.log);

And emit the chunk. Maybe there is already a plugin out there?