Svelte + TailwindCSS 2.0 starter template
The Svelte + TailwindCSS 2.0 + RollupJS starter is a template for building Svelte applications with TailwindCSS. It includes built-in support for TailwindCSS 2.0 and uses Rollup for bundling. The template also features a simple dark/light mode switch and a surprise button.
To install and get started with the Svelte + TailwindCSS 2.0 + RollupJS starter, follow these steps:
Install the necessary dependencies:
// Using npm
npm install
// Using yarn
yarn install
Start Rollup to run the application locally:
// Using npm
npm run dev
// Using yarn
yarn dev
Navigate to localhost:5000 in your browser to see the app running. Any changes saved in the source files will automatically reload the page.
To allow connections from other computers, edit the sirv commands in package.json to include the option --host 0.0.0.0
.
To create an optimized (production) version of the app, run the following command:
// Using npm
npm run build
// Using yarn
yarn build
The optimized app can be run with the command npm run start
, which uses sirv to serve the files.
If you’re building a single-page app with multiple routes, modify the “start” command in package.json to allow sirv to respond to requests for any path.
The Svelte + TailwindCSS 2.0 + RollupJS starter is a convenient template for developing Svelte applications with TailwindCSS. It offers support for the latest version of TailwindCSS, efficient bundling with Rollup, and additional features such as a dark/light mode switch and a surprise button. The installation process is straightforward, allowing developers to quickly set up and start building their applications.