https://github.com/rixo/svelte-template-webpack-hot
Clone of official Svelte template for Webpack with added HMR support
https://github.com/rixo/svelte-template-webpack-hot
hmr hot-module-replacement svelte svelte3 template webpack
Last synced: 2 months ago
JSON representation
Clone of official Svelte template for Webpack with added HMR support
- Host: GitHub
- URL: https://github.com/rixo/svelte-template-webpack-hot
- Owner: rixo
- Created: 2019-11-25T10:37:34.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-02-28T15:41:08.000Z (over 5 years ago)
- Last Synced: 2025-04-03T15:44:14.235Z (6 months ago)
- Topics: hmr, hot-module-replacement, svelte, svelte3, template, webpack
- Language: JavaScript
- Size: 104 KB
- Stars: 6
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Svelte Template Hot
This is a copy of official [Svelte template for Webpack](https://github.com/sveltejs/template-webpack) with added HMR support.
This template aims to remain as close to the official template as possible. Please refer to official docs for general usage. For HMR specific stuff, see bellow!
**:warning: Experimental :warning:**
This HMR implementation relies on Svelte's private & non documented API. This means that it can stop working with any new version of Svelte.
Progress of Svelte HMR support can be tracked in [this issue](https://github.com/sveltejs/svelte/issues/3632).
**NOTE** The template pins the major version of Svelte, using the [tilde comparator](https://docs.npmjs.com/misc/semver#tilde-ranges-123-12-1) because, in practice, HMR breakages tend to only happen with new major versions of Svelte. In your app, you can change this to your liking -- because you might be more interested in last version of Svelte than working HMR, or be wise and pin the exact versions of all you dependencies.
## Installation
To create a new project based on this template using [degit](https://github.com/Rich-Harris/degit):
```bash
npx degit rixo/svelte-template-webpack-hot svelte-app
cd svelte-app
npm install
```Run the build script a first time, in order to avoid 404 errors about missing `bundle.css` in the browser:
```bash
npm run build
```## Quick start
```bash
npm run dev
```Navigate to http://localhost:8080. You should see your app running. Edit a component file in `src`, save it, and... Eyeball!
## Usage / Add it to your project
TODO