A base for building shareable Svelte components as Web Components. Clone it with degit:
npx degit LunaTK/svelte-web-component-builder
cd svelte-web-component-builder
npm install # or yarn
Your component's source code lives in /src
.
- Run
npm install
(oryarn install
)
- Make your own Svelte components
- Include your components in
src/index.js
. Otherwise, it will not be included in build output - Run
npm run build
on your terminal - Build outputs are in
build/
test-module.html
: Use Svelte component as ESM moduletest-web-component.html
: Use Svelte component as Web Component
This repository is forked from sveltejs/component-template
For more basic information, please visit the original repository.