Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to execute loading module by require? #187

Open
lhf552004 opened this issue Aug 14, 2020 · 1 comment
Open

How to execute loading module by require? #187

lhf552004 opened this issue Aug 14, 2020 · 1 comment
Labels

Comments

@lhf552004
Copy link

lhf552004 commented Aug 14, 2020

Hi, I'm going to load a module below:
var lunrMutable = require('lunr-mutable-indexes');
But I don't know how to load this module correctly.
My steps is load a single file /lunr-mutable-indexes/lunr-mutable.js
But it is failed. The problem is this module is not a single file, besides it would load another module inside it. For example it would load lunr module.

engine = new Jurassic.ScriptEngine();
engine.ExecuteFile("lib/require.js/require.min.js");
engine.ExecuteFile("lib/lunr.js/lunr.js");
//engine.Execute("var lunrMutable = require('lunr-mutable-indexes');");
engine.ExecuteFile("lib/lunr-mutable-indexes/lunr-mutable.js");

image
image

@paulbartrum
Copy link
Owner

require() is a node.js-specific thing I think. There's a standard (ECMAScript) replacement called "import" but Jurassic doesn't support that either :-(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants