sciactive / pnotify

Beautiful JavaScript notifications with Web Notifications support.
https://sciactive.com/pnotify/
Apache License 2.0
3.65k stars 513 forks source link

Using with WebpackEncore #349

Open itokia opened 5 years ago

itokia commented 5 years ago

Hello, I would like to install PNotify in my symfony 4 project with webpackEncore. When I test a notification I get the error message PNotify is not defined.

My Webpack config :

.createSharedEntry('vendor', [
        'jquery',
        'jquery-ui/ui/effects/effect-slide',
        'bootstrap',
        'popper.js',
        'bootstrap-datepicker/dist/locales/bootstrap-datepicker.fr.min.js',
        'pnotify/dist/es/PNotify.js',
        './assets/js/base.js',
        './assets/css/app.scss'
    ])
new PNotify({
        title: "PNotify",
        type: "info",
        text: "Welcome. Try hovering over me. You can click things behind me, because I'm non-blocking.",
        nonblock: {
            nonblock: true
        },
        addclass: 'dark',
        styling: 'bootstrap4',
        hide: false,
        before_close: function(PNotify) {
            PNotify.update({
                title: PNotify.options.title + " - Enjoy your Stay",
                before_close: null
            });

            PNotify.queueRemove();

            return false;
        }
    });
hperrin commented 5 years ago

I can see three problems here.

hperrin commented 5 years ago

Please read the README.md file for information on how to install PNotify.