2018-04-03 17:49:11 +00:00
*Psst — looking for a shareable component template? Go here --> [sveltejs/component-template ](https://github.com/sveltejs/component-template )*
---
2017-08-06 00:20:53 +00:00
# svelte app
2019-05-11 11:25:23 +00:00
This is a project template for [Svelte ](https://svelte.dev ) apps. It lives at https://github.com/sveltejs/template.
2017-08-06 00:20:53 +00:00
To create a new project based on this template using [degit ](https://github.com/Rich-Harris/degit ):
```bash
2019-04-28 23:05:54 +00:00
npx degit sveltejs/template svelte-app
2017-08-06 00:20:53 +00:00
cd svelte-app
```
*Note that you will need to have [Node.js ](https://nodejs.org ) installed.*
## Get started
Install the dependencies...
```bash
cd svelte-app
npm install
```
2017-08-06 00:23:01 +00:00
...then start [Rollup ](https://rollupjs.org ):
2017-08-06 00:20:53 +00:00
```bash
npm run dev
```
Navigate to [localhost:5000 ](http://localhost:5000 ). You should see your app running. Edit a component file in `src` , save it, and reload the page to see your changes.
2019-09-24 02:52:24 +00:00
By default, the server will only respond to requests from localhost. To allow connections from other computers, edit the `sirv` commands in package.json to include the option `--host 0.0.0.0` .
2017-08-06 00:20:53 +00:00
## Deploying to the web
### With [now](https://zeit.co/now)
Install `now` if you haven't already:
```bash
npm install -g now
```
Then, from within your project folder:
```bash
2019-06-18 10:42:03 +00:00
cd public
2017-08-06 00:20:53 +00:00
now
```
As an alternative, use the [Now desktop client ](https://zeit.co/download ) and simply drag the unzipped project folder to the taskbar icon.
### With [surge](https://surge.sh/)
Install `surge` if you haven't already:
```bash
npm install -g surge
```
Then, from within your project folder:
```bash
npm run build
surge public
2017-08-06 00:23:01 +00:00
```