No description
Find a file
Rich Harris ee22737768 merge
2019-11-15 18:06:46 -05:00
public Update index.html 2019-07-16 08:16:22 +01:00
src centered Hello World! 2019-11-01 16:45:54 +06:00
.gitignore don't ignore lock files 2019-04-28 18:56:58 -04:00
package.json merge 2019-11-15 18:06:46 -05:00
README.md explain why sirv is in prod dependencies 2019-11-15 17:31:17 -05:00
rollup.config.js don't start dev server until bundle is generated (#73) 2019-10-23 09:43:45 -04:00
rollup_start_dev.js fix spawn on Windows (#80) 2019-10-23 12:19:21 -04:00

Psst — looking for a shareable component template? Go here --> sveltejs/component-template


svelte app

This is a project template for Svelte apps. It lives at https://github.com/sveltejs/template.

To create a new project based on this template using degit:

npx degit sveltejs/template svelte-app
cd svelte-app

Note that you will need to have Node.js installed.

Get started

Install the dependencies...

cd svelte-app
npm install

...then start Rollup:

npm run dev

Navigate to localhost:5000. You should see your app running. Edit a component file in src, save it, and reload the page to see your changes.

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.

Building and running in production mode

To create an optimised version of the app:

npm run build

You can run the newly built app with npm run start. This uses sirv, which is included in your package.json's dependencies so that the app will work on platforms that follow the npm run build/npm run start convention, like now.

Deploying to the web

With now

Install now if you haven't already:

npm install -g now

Then, from within your project folder:

cd public
now

As an alternative, use the Now desktop client and simply drag the unzipped project folder to the taskbar icon.

With surge

Install surge if you haven't already:

npm install -g surge

Then, from within your project folder:

npm run build
surge public