module-rewriter
v0.1.2
Published
Rewrites ESM import paths
Downloads
3
Readme
Rewrites ESM import paths. Powered by Web Assembly via prsr.
Usage
import build from 'module-rewriter';
const resolve = (importee, importer) => {
// importee is from import/export, importer is the current file
// TODO: this is a terrible resolver, don't do this
return `/node_modules/${importee}/index.js`;
};
build(resolve).then((rewriter) => {
const s = rewriter('input.js');
s.pipe(process.stdout);
});
Try out demo.js
in the repo or NPM install.