Everything you need to build a Svelte project, powered by sv.
If you're seeing this, you've probably already done this step. Congrats!
# create a new project in the current directory
npx sv create
# create a new project in my-app
npx sv create my-appOnce you've created a project and installed dependencies with npm install (or pnpm install or yarn), start a development server:
NODE_ENV=development npm run dev
# or start the server and open the app in a new browser tab
NODE_ENV=development npm run dev -- --openTo create a production version of your app:
NODE_ENV=development npm run buildYou can preview the production build with NODE_ENV=development npm run preview.
To deploy your app, you may need to install an adapter for your target environment.
npm i -D @sveltejs/adapter-static gh-pagesimport adapter from '@sveltejs/adapter-static';Add the following to src/routes/+layout.js
export const prerender = true;"gh-pages": "npm run build && npx gh-pages -d build"Now you just need to run npm run gh-pages.
If you are using a postcss such as Tailwind css, you need to add an empty .nojekyll file to the gh-pages branch.