Experimental node loader built on top of jspm utils to resolve deps from remote in nodejs
When executing
node --loader ./loader.js test.js
The following will be output
loader git:(main) node --loader ./loader.js test.js
(node:12944) ExperimentalWarning: --experimental-loader is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
testing
{
__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: {
usingClientEntryPoint: false,
Events: [
[Function: getInstanceFromNode],
[Function: getNodeFromInstance],
[Function: getFiberCurrentPropsFromNode],
[Function: enqueueStateRestore],
[Function: restoreStateIfNeeded],
[Function: batchedUpdates$1]
]
},
createPortal: [Function: createPortal$1],
createRoot: [Function: createRoot$1],
findDOMNode: [Function: findDOMNode],
flushSync: [Function: flushSync$1],
hydrate: [Function: hydrate],
hydrateRoot: [Function: hydrateRoot$1],
render: [Function: render],
unmountComponentAtNode: [Function: unmountComponentAtNode],
unstable_batchedUpdates: [Function: batchedUpdates$1],
unstable_renderSubtreeIntoContainer: [Function: renderSubtreeIntoContainer],
version: '18.2.0'
}
One very significant upside of using deps using the loader
and import-map
. The dependencies from test.js
loads
du -sh -I @jspm -I fs-extra -I node-fetch node_modules
50M node_modules
du -sh .cache
3.6M .cache
Try it yourself
Clone
git clone git@github.com:jspm/node-importmap-http-loader.git
Then via devcontainers, launch the container by clicking the devcontainer button or via the command palette.
To setup devcontainers
- Launch vscode or your favorite devcontainers enabled editor
- Install Remote Containers extension
- Launch the container by clicking the devcontainer button or via the command palette
Unrecommended and supported for issues, etc:
git clone git@github.com:jspm/node-importmap-http-loader.git
nvm i && npm i