Everything you need to build a Svelte library.
.d.ts
files for componentsOnce you've installed dependencies with pnpm install
(or npm install
), start the build with watcher:
pnpm dev
# or
npm run dev
Everything inside src/lib
is part of your library, everything inside src/routes
can be used as a showcase or preview app.
To build your library:
pnpm package
To create a production version of your showcase app:
pnpm build
You can preview the production build with pnpm preview
.
Go into the package.json
and give your package the desired name through the "name"
option and remove the "private"
field.
To publish your library to npm:
npm publish