Skip to content

Latest commit

 

History

History
41 lines (26 loc) · 1.02 KB

File metadata and controls

41 lines (26 loc) · 1.02 KB

Counter Library

A Svelte library created with create-svelte.

Developing

Install dependencies with npm install (or pnpm install or yarn), and start a development server:

npm run dev

Develop your library within src/lib. Reexport everything that should be publicly available from src/lib/index.js. Preview/showcase your work within src/routes. In this example, there's one Counter component.

Building

To prepare the library for release, run

npm run package

This will output everything that's inside src/lib into the dist folder, transforming TypeScript to JavaScript and creating type definitions. To publish the library to npm, run

npm publish

The result would be available for others as

<script>
	import { Counter } from 'your-library';
</script>

<Counter />

More info

Read the packaging docs for more info on how to create a Svelte library.