Graaljs: need loader support with hooks for context

Created on 24 Sep 2020  路  2Comments  路  Source: oracle/graaljs

js.commonjs-* options are great we need something like js.esm-loader and implement loader hooks

https://nodejs.org/api/esm.html#esm_experimental_loaders

it would also be great to have the same settings for esm

// (optional) folder where the NPM modules to be loaded are located.
options.put("js.commonjs-require-cwd", "/path/to/root/folder");
// (optional) initialization script to pre-define globals.
options.put("js.commonjs-global-properties", "./globals.js");
// (optional) Node.js built-in replacements as a comma separated list.
options.put("js.commonjs-core-modules-replacements",
"buffer:buffer/," +
"path:path-browserify");

Most helpful comment

ESM loaders and other ECMAScript modules-related features in Node.js are still marked as experimental APIs, and they might change in the future. We will implement them once they are stable.

All 2 comments

ESM loaders and other ECMAScript modules-related features in Node.js are still marked as experimental APIs, and they might change in the future. We will implement them once they are stable.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pmlopes picture pmlopes  路  4Comments

frank-dspeed picture frank-dspeed  路  3Comments

fniephaus picture fniephaus  路  7Comments

missedone picture missedone  路  4Comments

tosehee75 picture tosehee75  路  3Comments