I'm new to ES6, and I'm struggling to import a notification module "toaster-js" to my "sw-toolbox" (service worker cache API) script.
Specifically I want to alert the end user when a cache download has finished, and my PWA is available for offline browsing.
I can't figure out where to stick
import { Toast } from "toaster-js";
without incurring various syntax errors, mainly "import declarations may only appear at top level of a module" and "Unexpected token {"
If I try loading it through html by declaring <script type="module" [...]>, then the relevant handlers aren't recognized by my sw-toolbox script.
Any pointers would be much appreciated!
Thanks