dom-confetti icon indicating copy to clipboard operation
dom-confetti copied to clipboard

Support direct embed into HTML

Open bryanbraun opened this issue 6 years ago • 1 comments

I noticed that this library is set up to support a commonJS interface (like Node and Webpack). It would be great if it also supported being direct embedded into HTML. Currently, attempting that results in errors like: Uncaught ReferenceError: exports is not defined

We could use something like returnExports from UMD which lets a module work with Node (CommonJS), AMD (e.g. RequireJS) and browser globals. Or we could simplify it by not supporting AMD.

Love this library and how simple it is!

bryanbraun avatar Jul 04 '18 18:07 bryanbraun

Oh! It looks like you already have a babel plugin for doing this in your dev task. We just need to add it to your build task to ensure it gets in the production build. I can do a PR for that.

bryanbraun avatar Jul 04 '18 18:07 bryanbraun