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

Browserify-able npm module #274

Closed
danreeves opened this issue Dec 8, 2014 · 4 comments
Closed

Browserify-able npm module #274

danreeves opened this issue Dec 8, 2014 · 4 comments

Comments

@danreeves
Copy link

The current dist errors when required through browserify.

Browserify is not smart and tries resolving every require() it comes across, even the ones which have already been resolved (i.e. this file). This shouldn't be happening since the dist build has the standalone option. Using the .min file fixes this but it isn't included in the npm distribution.

According to this comment on a browserify issue derequire was removed from the standalone option, and it needs to be added as an additional transform.

@jhchen
Copy link
Member

jhchen commented Dec 8, 2014

To clarify you are trying to run command line browserify on a file that required Quill?

@danreeves
Copy link
Author

Yes; sorry, should have been more clear.

I am using browserify (through gulp) to build my project and Quill is a dependency in my project.

Steps to reproduce would be:

  • npm install quill
  • browserify app.js > bundle.js

Where app.js:

var Quill = require('quill');

The browserify errors are all missing dependencies that correspond to the requires inside quill.js. It gets to that point so I don't think the issues is the browser field in package.json as mentioned in issue #272.

If you see this issue it can be resolved by adding an additional step to the browserify build. I'm afraid I'm not a grunt or coffeescript guy, else I would have given a pull request a go.

Thanks.

@jhchen jhchen closed this as completed in a4b6d05 Dec 9, 2014
@jhchen
Copy link
Member

jhchen commented Dec 9, 2014

No worries those two linked issues were very helpful in getting to the bottom of this.

@danreeves
Copy link
Author

This is great. Thanks a lot!

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

2 participants