Comments (9)
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)!
from alertifyjs.
velocity-animate and cropper are similarly dedicated to browsers but are in npm.
Libraries like jQuery, moment, lodash, postal, q, and string that work on both client and server explicitly support using the npm installed package in the browser.
Browserify doesn't simply make node modules work in the browser. It lets you write your code in CommonJS/Node.js style using require()
and local module scope. Then when built wraps it up and automatically wraps up and bundles the code for any modules that it depends on via require()
.
If I were to npm install someclientlib --save
and then add var SomeClientLib = require('someclientlib');
and rebuild my client code, browserify would include the library and my module could just start using it.
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 require('foobar')
.
from alertifyjs.
Also, https://www.npmjs.com/package/alertify
from alertifyjs.
Though I do admit the "AMD and window support" section also needs an update to support browserify.
from alertifyjs.
Done.
from alertifyjs.
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;
}
from alertifyjs.
I'll make a pull request for the other tweaks for full npm/browserify support.
from alertifyjs.
That would be great!
from alertifyjs.
Published in 1.2.0
Thanks!
from alertifyjs.
Related Issues (20)
- Multiple alert boxes go away at once HOT 1
- Close all alertify messages
- Sequential Prompts HOT 1
- Auto-Dismiss Alerts HOT 1
- Why is impossible change anything from default options??? HOT 1
- Instance vs global properties HOT 1
- alertify.notify stopped showing in safari macos HOT 3
- onshow only firing on second alertify.confirm() call HOT 2
- License using LGPL HOT 1
- ESC/ENTER/TAB Press always invoke oncancel call HOT 1
- 'alertifyjs'. CommonJS or AMD dependencies HOT 3
- Correction on Guide HOT 1
- Commercial license purchase not working? HOT 4
- Cannot read properties of undefined (reading 'preinit') HOT 3
- Brave blocks Alertify HOT 6
- setContent `textarea` get its value HOT 2
- Notify & modal HOT 2
- adding number input to confirm dialog HOT 1
- After Show Event
- Support wrapped instances of String HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from alertifyjs.