Skip to content

Instantly share code, notes, and snippets.

@nwgambee
Last active April 3, 2020 02:49
Show Gist options
  • Save nwgambee/2216c410ba3d79d21b8d3ae8fcbf83b0 to your computer and use it in GitHub Desktop.
Save nwgambee/2216c410ba3d79d21b8d3ae8fcbf83b0 to your computer and use it in GitHub Desktop.
mod 4 cross pollination front end set up instructions for Svelte

Cross-Poll Svelte w/ Svelte Router Front End Environment Set-Up

  • To make a Svelte playground with a template, use this repo and follow the instructions in it's readme. If you want to use Svelte Router with the template, make sure to do the other steps below
  1. Clone down the repo or navigate into the template you've made with the steps above
  2. From the root directory of the project, run npm install and then run npm install --save svelte-routing
  3. Make sure the scripts property of your package.json file looks like this (there is a bug with svelte-router that requires this):
"scripts": {
    "build": "rollup -c",
    "dev": "rollup -c -w",
    "start": "sirv public --single",
    "start:dev": "sirv public --dev --single"
  }
  1. Run npm run dev to boot up the local server
  2. You should see:
Your application is ready~! πŸš€

- Local:      http://localhost:5000

────────────────── LOGS ──────────────────
  1. Navigate to http://localhost:5000/ in your browser, you should see HELLO WORLD in big orange text with a link to the Svelte tutorial below it
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment