Giter VIP home page Giter VIP logo

sveltekit-gitpod's Introduction

Sveltekit App Template With Gitpod Setup

Everything you need to build a Sveltekut project in Gitpod;

Note: Below steps are already implemented in .gitpod.yml so you can create a new repository based on this template and open in Gitpod and everything will work as expected.

Special config for Gitpod to make HMR work

Sveltekit needs to know how to reach the HMR endpoint. To configure that we need to do two things in our config:

  1. Set an environment variable
 export WS_URL=$(gp url 24678 | sed 's/https\?:\/\///')
  1. Configure the env value in svelte.config.js
		kit: {
		// ... other config
		vite: {
            // ... other config
			server: {
				hmr: {
					host: process.env.WS_URL,
					clientPort: process.env.WS_URL ? 443 : null
				}
			}
		}
	}

This will set HMR URL with the workspace url of 24678 (default port for HMR).

Building

Before creating a production version of your app, install an adapter for your target environment. Then:

npm run build

You can preview the built app with npm run preview, regardless of whether you installed an adapter. This should not be used to serve your app in production.

sveltekit-gitpod's People

Contributors

vinaypuppal avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.