3 ms·
I don't love the loader hooks change with `register`. Was much simpler to leverage the command line flag `--experimental-loader` and pass in the file that expor
by halfmatthalfcat 3y ago
I don't love the loader hooks change with `register`. Was much simpler to leverage the command line flag `--experimental-loader` and pass in the file that exports the hooks. Now I need another file that basically just calls register against my loader file.
- pier25 3y agoIs this for the ESM custom loaders?
- halfmatthalfcat 3y agoYeah, it is. Glad they've moved it to RC status but the API has gone through a ton of flux.
- eyelidlessness 3y agoI haven’t touched module loader hooks for a while, but my impression is that the changes bring it more conceptually in line with require hooks. Loader authors will likely provide the register call for end users (to load with --import, roughly analogous to loading require hooks with --require?), so you won’t need to call anything in an extra step unless you’re authoring a loader yourself. In which case this provides for composition patterns which the earlier CLI-only entry (mostly) didn’t.