-
Notifications
You must be signed in to change notification settings - Fork 304
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
Publish to npm #22
Comments
I'm not sure if its useful to publish to npm, as this is not a node module. It has pacakage.json mainly for installing dev. dependencies. Don't know how Browserify fits here, its supposed to work the other way around (making node modules work in the browser)! |
velocity-animate and cropper are similarly dedicated to browsers but are in npm. Browserify doesn't simply make node modules work in the browser. It lets you write your code in CommonJS/Node.js style using If I were to The standard source for these browserify looks for in is npm (or rather node_modules/) where package.json can have an optional tiny bit extra if the package should use a different set of modules on the client. To include something not in npm I have to mess around, either doing an ugly relative require or adding a hack to my package.json to tell it to load a certain file when I write |
Though I do admit the "AMD and window support" section also needs an update to support browserify. |
Done. |
Something like: // AMD and window support
if ( typeof module === 'object' && typeof module.exports === 'object' ) {
module.exports = alertify;
} else if ( typeof define === 'function' ) {
define( [], function () {
return alertify;
} );
} else if ( !window.alertify ) {
window.alertify = alertify;
} |
I'll make a pull request for the other tweaks for full npm/browserify support. |
That would be great! |
Published in 1.2.0 Thanks! |
This library has a packages.json but doesn't appear to be published on npm.
browserify is easiest to use with npm modules so it would be nice to have it published.
The text was updated successfully, but these errors were encountered: