preactjs / preact-custom-element

Wrap your component up as a custom element
MIT License
360 stars 52 forks source link

How do I use with unpkg? #57

Closed rajasimon closed 3 years ago

rajasimon commented 3 years ago

I tried using preact-custom-element using unpkg but seems I ran into this issue.

import register from "https://unpkg.com/preact-custom-element@4.2.1/dist/preact-custom-element.umd.js"

but I got this below error.

Uncaught SyntaxError: The requested module 'https://unpkg.com/preact-custom-element@4.2.1/dist/preact-custom-element.umd.js' does not provide an export named 'default'

rajasimon commented 3 years ago

Tried with different files in the dist folder and I finally can able to use it via this

import register from "https://unpkg.com/preact-custom-element@4.2.1/dist/preact-ce.module.js?module"