This project is a boilerplate for creating Chrome extensions using Svelte and Vite. It provides a solid starting point for developers who want to leverage Svelte's reactive capabilities in their Chrome extensions.
Clone this repository:
git clone https://github.com/xettrialeen/Svelte_ChromeExtension_BoilerPlate.git
cd svelte-chrome-extension-boilerplate
Install dependencies:
npm install
Build the extension:
npm run build
Load the extension in Chrome:
chrome://extensions
dist
directory in your project folderRun the development build with watch mode:
npm run dev
This will rebuild the extension automatically when you make changes.
After making changes, you need to reload the extension in Chrome:
chrome://extensions
src/
āāā popup/
ā āāā popup.html
ā āāā popup.js
ā āāā App.svelte
āāā content/
ā āāā content.js
ā āāā ShadowComponent.svelte
āāā background.js
āāā app.css
public/
āāā manifest.json
āāā icon.png
popup/
: Contains the extension popup filescontent/
: Contains the content script and injected Svelte componentbackground.js
: Background script for the extensionapp.css
: Global styles and Tailwind importspublic/
: Contains static files like manifest.json and iconsTo create a production build, run:
npm run build
This will generate optimized files in the dist
directory, ready for submission to the Chrome Web Store.
Contributions are welcome! Please feel free to submit a Pull Request.
This project is open source and available under the MIT License.
Happy coding! If you have any questions or run into issues, please open an issue in this repository.