svelte-template

Svelte Template

Svelte template using Rollup, PostCSS, Babel, Tailwind CSS, and PWA

svelte template


This is a basic Svelte Svelte template customized for my general needs (Babel, Tailwind, PostCSS, PurgeCSS, and PWA). Much credit to the OG svelte template and muhajirdev/svelte-tailwind-template, the code of which I've liberally swiped.

To create a new project based on this template using degit:

npx degit tobinbradley/svelte-template svelte-app

Note that you will need to have Node.js installed.

Get started

Install the dependencies...

cd svelte-app
npm install

...then start Rollup:

npm start

Navigate to localhost:3000. You should see your app running. Edit a component file in src, save it, and reload the page to see your changes.

By default, the server will only respond to requests from localhost. To allow connections from other computers, edit the sirv commands in package.json to include the option --host 0.0.0.0.

Deploying to the web

To build the site for production:

npm run build

Copy the contents of the public folder to your web server.

Top categories

Loading Svelte Themes