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

Fix require()s to support browserify #8

Closed
wants to merge 1 commit into from

Conversation

@bajtos
Copy link

@bajtos bajtos commented Jun 26, 2014

Modify the require() call in index.js to use a static relative path,
instead of building a dynamic absolute path using path.join().

This change is necessary to make the module work with browserify,
since browserify does not support dynamic paths in require().

This patch fixes the problem introduced by 0e974f0 in v1.0.1.

/to @dcodeIO could you please merge and release ASAP?

If you still prefer to use path.join instead of relative paths, then there is another possible fix - add a browser entry to the package.json to tell browserify to use dist/bcrypt.js instead of index.js as the package entry file.

Another option is to drop the index.js file and add "main": "dist/bcrypt.js" to package.json.

There are many possible solutions and I don't really care which one will be used at the end, as long as we can get a fixed version in the npm soon.

Miroslav Bajtoš
Modify the `require()` call in index.js to use a static relative path,
instead of building a dynamic absolute path using `path.join()`.

This change is necessary to make the module work with browserify,
since browserify does not support dynamic paths in `require()`.
bajtos referenced this pull request in strongloop/loopback Jun 26, 2014
Raymond Feng
@dcodeIO dcodeIO closed this in 565bee8 Jun 26, 2014
@bajtos
Copy link
Author

@bajtos bajtos commented Jun 26, 2014

Thank you for the quick response 👍

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

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.