This is a project template for Svelte apps. It lives at https://github.com/ehedenst/svelte-template.
To create a new project based on this template using degit:
npx degit ehedenst/svelte-template svelte-app
cd svelte-app
Note that you will need to have Node.js installed.
Install the dependencies...
cd svelte-app
yarn
...then start Rollup:
yarn serve
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 serve
plugin in rollup.config.js and set the host to '0.0.0.0'.
To create an optimised version of the app:
yarn build
Install now
if you haven't already:
yarn global add now
Then, from within your project folder:
cd public
now deploy --name my-project
As an alternative, use the Now desktop client and simply drag the unzipped project folder to the taskbar icon.
Install surge
if you haven't already:
yarn global add surge
Then, from within your project folder:
npm run build
surge public my-project.surge.sh