Easily install, configure and compose Node.js ESM loaders.
This module is experimental and the API is definitely going to change.
Feel free to play with it and give feedback but don't use it in production :).
Start by installing the orchestrator:
npm install @multiloader/loaderThen create a file in your project. This will be the entrypoint of your custom loader:
touch loader.mjsStart with the following piece of code. It creates a loader that does nothing:
export * from '@multiloader/loader';
import configureLoader from '@multiloader/loader';
configureLoader();Then install and add all the loaders that you need. We'll use the https loader as an example.
Install the additional loader:
npm install @multiloader/httpsEdit loader.mjs:
export * from '@multiloader/loader';
import configureLoader from '@multiloader/loader';
+import https from '@multiloader/https';
-configureLoader();
+configureLoader(https());That's it! You can now import modules from "https:" URLs.