Important
Community add-ons are currently not supported. Please see #184 for details.
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 add-ons.
The add-on template for community add-ons for sv
.
Use degit
to clone the template:
npx degit sveltejs/cli/community-addon-template addon-name
To run the add-on, 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 add-on, run:
npm start
When you're ready to publish your add-on to NPM, run:
npm publish
Your published add-on can now be used by anyone!
To execute the newly published package with sv
, run:
npx sv add --community npm:addon-package-name
After that, feel free to open a pull request to sv
and add your add-on to the community list.
Community add-ons are not permitted to have any external dependencies outside of @sveltejs/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.).