Deploying Svelte on CloudStation
Introduction
Svelte is a modern JavaScript framework for building fast and lightweight web applications. Unlike traditional frameworks, Svelte shifts much of the work to compile time, resulting in highly efficient applications.
This guide will walk you through deploying a Svelte application on CloudStation for a seamless hosting experience.
Prerequisites
Before you begin, make sure you have the following:
- A Svelte Application: You can create a new Svelte project or use an existing one.
- GitHub Account Connected to CloudStation: CloudStation supports GitHub integration for automated deployments. Learn how to link your GitHub account here.
Creating a Svelte Application
If you don’t have a Svelte application yet, follow these steps to create one:
-
Install Node.js
Ensure you have Node.js installed on your machine. -
Create a New Svelte Project
Use the following command to create a new Svelte project:npm create vite@latest my-svelte-app -- --template svelte
-
Navigate to the Project Directory
cd my-svelte-app
-
Install Dependencies
npm install
-
Start the Development Server
Run the following command to start the development server and preview your app locally:npm run dev
For more details, refer to the official Svelte documentation.
Deploy Svelte on CloudStation
Deploying Svelte to CloudStation
-
Log in and Create a New Project or Select an Existing One
- Log into CloudStation, go to Dashboard > New Project, and click Add New Git Repo. Select your Svelte project and import it.
- If you don't have a project, create a new one.
-
Connect Your GitHub Repository
- If your GitHub account isn’t linked, follow the prompts to connect it.
- Select your Svelte project repository from the available list.
More details
-
Set Up Deployment Configuration
- Specify the build command as
npm run build
. - Set the output directory to
build/
. - Configure any required environment variables.
More details
- Specify the build command as
-
Deploy Your Svelte Application
Click Deploy to start the deployment process. CloudStation will pull the latest code from your repository and deploy your application.
Edit this file on GitHub