My portfolio built with SvelteKit, Pocketbase, Notion as a CMS, and hosted on Vercel :)
The create-svelte tool provides everything necessary for building a Svelte project. It simplifies the process of project creation, development, and deployment.
To start using create-svelte, follow these steps:
Make sure you have Node.js and npm installed on your machine.
Open the terminal and navigate to the desired directory where you want to create your Svelte project.
Run the following command to install create-svelte globally:
npm install -g create-svelte
After the installation is complete, use the following command to create a new Svelte project:
create-svelte my-project
Replace “my-project” with the desired name for your project.
Once the project is created, navigate into the project directory:
cd my-project
Install the project dependencies by running any of the following commands based on your preferred package manager:
For npm:
npm install
For pnpm:
pnpm install
For yarn:
yarn
Now you can start the development server:
npm run dev
This will launch the development server, allowing you to view and test your Svelte project.
To create a production-ready build of your app, run the following command:
npm run build
This will generate an optimized and minified version of your app for deployment.
If you want to preview the production build before deploying, use the following command:
npm run preview
This will start a local server hosting the production build, allowing you to preview it in your browser.
Depending on your target environment, you may need to install an adapter. Follow the specific instructions provided for your target environment to install the required adapter.
Create-svelte is a powerful tool for building Svelte projects. It simplifies the project creation process, manages dependencies, and provides convenient commands for development, production builds, and previewing. With the ability to install specific adapters, it offers flexibility for deploying projects to various environments. Overall, create-svelte offers a seamless and efficient workflow for Svelte developers.