sciactive / pnotify

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

how to use on codesandbox.io (for Svelte) #333

Closed mspanish closed 6 years ago

mspanish commented 6 years ago

Hey very cool you are already using Svelte - but do you know how I can import & use this in a codesandbox.io project that uses Svelte? I tried adding it as a dependency and using import { PNotify } from 'pnotify'; but PNotify didn't work after that.

My sandbox is here

Any ideas would be really great!

hperrin commented 6 years ago

Hi @mspanish. I think to import it in a module, you want to import the ES build, which is:

import PNotify from 'pnotify/dist/es/PNotify';

To import it in a Svelte component, I think you'd use:

import PNotify from 'pnotify/src/PNotify.html';
hperrin commented 6 years ago

I updated your sandbox here.

mspanish commented 6 years ago

awesome thank you so much - way better than the other thing I was looking at - much prettier!