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

Pre-build semver.browser.js for Bower/RequireJS users #55

Closed
codeaholics opened this issue Nov 13, 2013 · 7 comments
Closed

Pre-build semver.browser.js for Bower/RequireJS users #55

codeaholics opened this issue Nov 13, 2013 · 7 comments

Comments

@codeaholics
Copy link

I'm trying to use node-semver in the browser using Bower and RequireJS. I've installed it using 'bower install isaacs/node-semver' and that works fine, but because I then want to use it in the browser (using RequireJS which provides an AMD environment) I need semver.browser.js.

Right now, I don't have any kind of "build process", and I'd rather not add one unless I have to ;-)

Other libraries handle this by committing their built artifacts (something which I'd abhor if they were binaries - e.g. JARs). For example, https://github.com/twbs/bootstrap/tree/master/dist. So when you install bootstrap using Bower, you simply serve the JS/CSS/etc. from .../bower_components/bootstrap/dist.

Would it be possible for you to commit semver.browser.js as part of your build/release process?

@codeaholics
Copy link
Author

Or, to make a single file that works in both the browser and node, etc. I'd happily volunteer to help with this but I don't fully understand the issues that make the current approach necessary.

@eddiemonge
Copy link
Contributor

I think this was implemented with isaacs@4428702 unless you want something else?

@codeaholics
Copy link
Author

This requires a build step to generate the AMD-ready bundle, which most other libraries don't. Lots of simple projects don't have build steps.

@eddiemonge
Copy link
Contributor

from npm install:

ls node_modules/semver
----------------------------
LICENSE              README.md            foot.js              package.json         
semver.browser.js.gz semver.min.js        test
Makefile             bin                  head.js              
semver.browser.js    semver.js            semver.min.js.gz

Its a npm module, not a bower one. npm install it and then require it. Or make a bower compatible fork.

@codeaholics
Copy link
Author

Or raise an issue asking the author to make it bower compatible...

@isaacs
Copy link
Contributor

isaacs commented Sep 9, 2014

Install from npm, or run the build script. I'm not going to commit build artifacts to git, sorry.

@isaacs isaacs closed this as completed Sep 9, 2014
@codeaholics
Copy link
Author

That's OK. I moved off the project that required this months ago.

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

3 participants