https://github.com/patricknelson/svelte-v4-custom-elements-define
Repro for issue #8681
https://github.com/patricknelson/svelte-v4-custom-elements-define
Last synced: about 2 months ago
JSON representation
Repro for issue #8681
- Host: GitHub
- URL: https://github.com/patricknelson/svelte-v4-custom-elements-define
- Owner: patricknelson
- License: mit
- Created: 2023-06-01T01:41:32.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-06-01T19:48:03.000Z (about 3 years ago)
- Last Synced: 2025-12-26T07:51:32.227Z (6 months ago)
- Language: JavaScript
- Homepage: https://github.com/sveltejs/svelte/issues/8681
- Size: 28.3 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# svelte-v4-custom-elements-define
Demos an issue with manually defining custom elements in Svelte 4 (pre-release) using `customElements.define()`.
## Get started
Init repo
```bash
git clone https://github.com/patricknelson/svelte-v4-custom-elements-define.git
cd svelte-v4-custom-elements-define
npm i
```
Reproduce bug
```bash
git checkout main
npm run dev
```
Test workaround
```bash
git checkout workaround
npm run dev
```
## From scratch
Init base files
```bash
# select Svelte + JavaScript
npm init vite
# Install but overwrite with Svelte v4
npm i -D svelte@4.0.0-next.0
```
Update Svelte compiler options in `vite.config.js` to enable custom elements, i.e. `customElement: true`.