Skip to content

Commit

Permalink
Standardize the README content.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Nikles authored Jun 25, 2021
1 parent 5a1af85 commit a6c5701
Showing 1 changed file with 27 additions and 19 deletions.
46 changes: 27 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,37 @@
# A Svelte template on Gitpod

# svelte app with Gitpod setup
This is a [Svelte](https://svelte.dev) template configured for ephemeral development environments on [Gitpod](https://www.gitpod.io/).

[![Gitpod ready-to-code](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/from-referrer/)
## SvelteKit

This is a project template for [Svelte](https://svelte.dev) apps.
If you are looking for a SvelteKit example, please use https://github.com/gitpod-io/template-sveltekit.

## SvelteKit
## Next Steps

Click the button below to start a new development environment:

[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/gitpod-io/template-sveltejs)

If you are looking for a SvelteKit example, please use https://github.com/gitpod-io/sveltekit-example.
## Get Started With Your Own Project

## Special config for Gitpod to make rollup work
### A new project

Rollup needs to know how to reach the livereload endpoint. To configure that we need to do two things in our config:
Click the above "Open in Gitpod" button to start a new workspace. Once you're ready to push your first code changes, Gitpod will guide you to fork this project so you own it.

1) set an environment variable
```
export CLIENT_URL="$(gp url 35729)/livereload.js?snipver=1&port=443"
```
2) pass the env value to the livereload module in [`rollup.config.js:65`](https://github.com/gitpod-io/sveltejs-template/blob/587088aae9cb7331c27591b7f8cef9d58c037e46/rollup.config.js#L66-L69)
```js
!production && livereload({
watch: 'public',
clientUrl: process.env.CLIENT_URL
}),
```
### An existing project

This will set `CLIENT_URL` with the workspace url of `35729` (default port for livereload).
To get started with Svelte on Gitpod, add a [`.gitpod.yml`](./.gitpod.yml) file which contains the configuration to improve the developer experience on Gitpod. To learn more, please see the [Getting Started](https://www.gitpod.io/docs/getting-started) documentation.

In addition, please perform the following steps:
1. Set an environment variable
```bash
export CLIENT_URL="$(gp url 35729)/livereload.js?snipver=1&port=443"
```
1. Pass the env value to the livereload module in [`rollup.config.js:65`](https://github.com/gitpod-io/sveltejs-template/blob/587088aae9cb7331c27591b7f8cef9d58c037e46/rollup.config.js#L66-L69)
```js
!production && livereload({
watch: 'public',
clientUrl: process.env.CLIENT_URL
}),
```
This will set `CLIENT_URL` with the workspace url of `35729` (default port for livereload).

0 comments on commit a6c5701

Please sign in to comment.