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/loader
Then create a file in your project. This will be the entrypoint of your custom loader:
touch loader.mjs
Start 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/https
Edit 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.