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

Does not work with AMD loader? #299

Closed
liuzhen2008 opened this issue Sep 24, 2015 · 2 comments
Closed

Does not work with AMD loader? #299

liuzhen2008 opened this issue Sep 24, 2015 · 2 comments
Milestone

Comments

@liuzhen2008
Copy link

I have a AMD loader implemented on the sever side. But when I do
define("moduleName", ["node-forge", "my other modules"], function(nodeforge, otherModules) {});
I get Error: Cannot find module './aes'

Googling around, it seems that the issue is fixed sometime ago. Does that mean there is an AMD loader implementation issue on my side? Or is there some kind of workaround?

@dlongley
Copy link
Member

Using RequireJS and a packages config that includes forge like so:

"packages": [
    {
      "name": "forge",
      "main": "js/forge.js",
      "location": "/bower_components/forge"
    }
]

Should allow you to do this:

define(['forge'], function(forge) {
  // ...
});

An example of including individual modules from forge:

define(['forge/js/md', 'forge/js/pki', 'forge/js/util', function(md, pki, util) {
  // ...
});

We want to make loading forge much easier and have it work with a variety of loaders in the future, see number 6 of #203.

@ysangkok
Copy link

ysangkok commented Feb 9, 2016

@liuzhen2008 I have replaced RequireJS with CommonJS (e.g. using Webpack). Check it out, maybe it works for you: #357

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

No branches or pull requests

4 participants