Vite x Svelte Boilerplate

šŸš€ Project Structure

Inside of your Svelte project, you'll see the following folders and files:

/
ā”œā”€ā”€ public/
ā”‚   ā””ā”€ā”€ vite.svg
ā”œā”€ā”€ src/
ā”‚   ā””ā”€ā”€ assets/
ā”‚       ā”œā”€ā”€ svelte.svg
|   ā””ā”€ā”€ lib/
ā”‚       ā”œā”€ā”€ Counter.svelte
|   ā”œā”€ā”€ app.css
|   ā”œā”€ā”€ App.svelte
|   ā”œā”€ā”€ main.js
|   ā”œā”€ā”€ vite-env.d.ts
ā”œā”€ā”€ index.html
ā”œā”€ā”€ jsconfig.json
ā”œā”€ā”€ package.json
ā”œā”€ā”€ README.md
ā”œā”€ā”€ svelte.config.js
ā””ā”€ā”€ vite.config.js

Any static assets, like images, can be placed in the public/ directory.

āš” How to deploy to Fleek

1. Create a fleek.config.json config file:

You can configure this site deployment using Fleek CLI and running:

 > fleek sites init
   WARN! Fleek CLI is in beta phase, use it under your own responsibility
   ? Choose one of the existing sites or create a new one. ā€ŗ 
   āÆ Create a new site

It will prompt you for a name, dist directory location & build command

  • name: How you want to name the site
  • dist: The output directory where the site is located, for this template it's dist
  • build command: Command to build your site, this will be used to deploy the latest version either by CLI or Github Actions

2. Deploy the site

After configuiring your fleek.config.json file, you can deploy the site by running

fleek sites deploy

After running it you will get an output like this:

 WARN! Fleek CLI is in beta, use it at your own discretion
 > Success! Deployed!
 > Site IPFS CID: QmP1nDyoHqSrRabwUSrxRV3DJqiKH7b9t1tpLcr1NTkm1M

 > You can visit through the gateway:
 > https://ipfs.io/ipfs/QmP1nDyoHqSrRabwUSrxRV3DJqiKH7b9t1tpLcr1NTkm1M

Top categories

svelte logo

Need a Svelte website built?

Hire a professional Svelte developer today.
Loading Svelte Themes