Important
This template's dependencies may not be up-to-date; be sure to update them to the latest! If you get stuck, check out the implementations of official adders.
The adder template for community adders for sv
.
Use degit
to clone the template:
npx degit sveltejs/cli/community-adder-template adder-name
To run the adder, we'll first need a project to apply it to.
Create the project with the following script:
npm run create-temp
This will create a SvelteKit project in the temp
directory.
To execute the adder, run:
npm start
When you're ready to publish your adder to NPM, run:
npm publish
Your published adder can now be used by anyone!
To execute the newly published package with sv
, run:
npx sv add --community npm:adder-package-name
After that, feel free to open a pull request to sv
and add your adder to the community list.
Community adders are not permitted to have any external dependencies outside of @svelte-cli/core
. If the use of a dependency is absolutely necessary, then they can be bundled using a bundler of your choosing (e.g. Rollup, Rolldown, tsup, etc.).