...will generate a module load exception like this on es4x 0.17.0:
ModuleError: Module "some-dependency/some-directory/some-file.json" was not found
at <js> Require.resolve(node_modules\.lib\es4x-0.17.0.jar!\io\reactiverse\es4x\jvm-npm.js:122:3628-3706)
at <js> Require(node_modules\.lib\es4x-0.17.0.jar!\io\reactiverse\es4x\jvm-npm.js:89:2669-2695)
at <js> this.require(node_modules\.lib\es4x-0.17.0.jar!\io\reactiverse\es4x\jvm-npm.js:46:1459-1475)
In order to successfully use require for json files on es4x 0.17.0, a relative path (from the directory where the js file with the require statement is included) is required, like so:
Given a filesystem layout like this:
A require statement like this in
lib/main.js
:...will generate a module load exception like this on es4x 0.17.0:
In order to successfully use
require
for json files on es4x 0.17.0, a relative path (from the directory where the js file with the require statement is included) is required, like so:The require statement should not require relative path specifications for json files provided by dependencies.