Closed AdrianKuriata closed 6 years ago
If you're importing UMD, it will be the export called "default". You can use something like this:
requirejs(['PNotify'], function(PNotify){
PNotify = PNotify && PNotify.__esModule ? PNotify["default"] : PNotify;
PNotify.notice({
title: "Yay!",
text: "It works!"
});
});
Changing
import PNotify from 'pnotify';
to
import PNotify from 'pnotify/dist/es';
Works for me on 4.0.0-alpha.2 on webpack
import PNotify from 'pnotify/dist/es/PNotify'; import PNotifyButtons from 'pnotify/dist/es/PNotifyButtons'; PNotify.defaults.styling = 'bootstrap4'; PNotify.defaults.icons = 'fontawesome5';
PNotify.notice({ title: 'Animate.css Effect', text: 'I use effects from Animate.css. Such smooth CSS3 transitions make me feel like butter.', modules: { Animate: { animate: true, inClass: 'bounceInLeft', outClass: 'bounceOutRight' } } });
Hi, i updated to newest alpha version PNotify and tried use it with bootstrap4 and fontawesom4. Every time got error when import it with webpack like umd, es or iife. Just only when i imported ES module and use
Just start working, when i tried use
PNotify.defaults
andPNotify.alert
i got error this is not defined. So if someone have a problem like me, just need tu usePNotify.default.defaults
etc.