Awesome
Svelte Router Template
Boilerplate template project for spaceavocado/svelte-router - Simple Svelte Router for Single Page Applications (SPA).
Live Preview
https://spaceavocado.github.io/svelte-router-template/
Setup
- Clone this repository or create your repository from this template.
- Install packages:
npm install
oryarn install
Essential Information
- 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, });
Local Development Server
To run the development server that provides live reloading, run:
npm run start
or yarn start
Production Build
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
License
Svelte Router is released under the MIT license. See LICENSE.txt.