I am new google to google v8.
I modified v8 hello world app.
const char* testJS = R"(
var assert = require("assert");
1 + 2;
)";
v8::Local<v8::Script> script = v8::Script::Compile(context, testJS).ToLocalChecked();
https://chromium.googlesource.com/v8/v8/+/branch-heads/5.8/samples/hello-world.cc
but got exception when running
Uncaught ReferenceError: require is not defined
So my question is, how could I 1) use 'require' in google v8 2) Make a custom common javascript class could be used as 'require(xyz)'
is they are related to v8::StartupData, but I don't know how to setup them correctly. Any advice would be appreciated.
thanks