fabien-d / alertify.js

JavaScript Alert/Notification System
http://fabien-d.github.com/alertify.js/
4.26k stars 726 forks source link

Working with webpack #263

Open laterbreh opened 7 years ago

laterbreh commented 7 years ago

Hi, I have been using Alertify with Webpack for a while, and I always had changed: Line 626 from:

(this));

To:

(window));

Works normally with this change even when not using webpack (Though I have not extensively used it outside of Webpack, but it seems to work perfectly).

Just thought I'd drop the pull request so this line does not have to be changed every time it's installed via NPM for Webpack users.

If you don't want this, its OK, just thought I'd make a suggestion.

Thanks!

laterbreh commented 7 years ago

I also noticed in the issues #248 mentioned this.

micahalcorn commented 6 years ago

@laterbreh do you happen to have your fork on NPM? Or do you know of a way to configure webpack to play nice with this old version Alertify? 🙏

laterbreh commented 6 years ago

@micahalcorn

Check the files changed tab on this pull, just swap this to window as demonstrated in the pull request.

Hopefully that helps!

micahalcorn commented 6 years ago

@laterbreh thanks, I had confirmed that it worked, but I need a reliable way to include it in an open-source project so that everyone doesn't have to tweak their node installation. I don't have any webpack experience, but I was hoping that there was a way to get it working as an AMD module. 😕

Although it actually seems to be using the AMD factory even though define is undefined in my experience. I'm not sure how that's possible.