Open charsleysa opened 3 years ago
If anyone is having issues pulling in ESM modules into fusebox for the time being, use a library like simport
which will make that lib compatible with fusebox.
Here's an example using 'p-queue', a pure ESM lib (and synchronised promise so it could be run on top level)
import PQueue from 'p-queue';
import sp from 'synchronized-promise';
import { createSimport } from 'simport';
const simport = createSimport(__filename);
const importPqueue = () => {
return new Promise(async (resolve) => {
const pqueueImport = await simport('../node_modules/p-queue/dist/index.js');
resolve(pqueueImport.default);
});
};
const queue: PQueue = new ((sp(importPqueue) as any)())({ concurrency: 1 });
I think for the output you're supposed to use some other tool. Not a bundler.
@charsleysa , perhaps you could create a plugin that leverages microbundle?
Are there any plans for supporting ESModule output?
I see a lot of other tools and packages are switching the ESModule output, some exclusively only output ESModule and ditching UMD/AMD/CommonJS.
Would be great if fuse-box supported this as we are looking to switch over to ESModule output.