Boilerplate template project for spaceavocado/svelte-router - Simple Svelte Router for Single Page Applications (SPA).
https://spaceavocado.github.io/svelte-router-template/
- Clone this repository or create your repository from this template.
- Install packages:
npm install
oryarn install
- Webpack based project.
- JS transpiled with Babel.
- SCSS for Svelte integrated with Svelte Preprocess, please see svelte.config.js for integration details.
- Pug for Svelte integrated with Svelte Preprocess, please see the Svelte Pug syntax limitations.
- The template is set to use the Svelte Router HTML5 history mode, to switch it to HASH mode, please see the Router Options.
createRouter({ mode: ROUTER_MODE.HASH, });
To run the development server that provides live reloading, run:
npm run start
or yarn start
npm run build:prod
or yarn build:prod
Note: If hosted in a sub-folder, e.g. domain.com/project/, please update the baseURL in:
- webpack.config.js
- package.json
The productions files are located in /publish folder:
- index.html
- dist
- assets
Svelte Router is released under the MIT license. See LICENSE.txt.