All Projects → rixo → svelte-template-hot

rixo / svelte-template-hot

Licence: other
Copy of official Svelte template with added HMR support

Programming Languages

javascript
184084 projects - #8 most used programming language
CSS
56736 projects
Svelte
593 projects
HTML
75241 projects

Projects that are alternatives of or similar to svelte-template-hot

rollup-plugin-svelte-hot
Fork of official rollup-plugin-svelte with added HMR support (for both Nollup or Rollup)
Stars: ✭ 49 (-19.67%)
Mutual labels:  hmr, rollup, svelte, hot-module-replacement, svelte-v3
svelte-loader-hot
Webpack loader for svelte components with HMR support
Stars: ✭ 22 (-63.93%)
Mutual labels:  hmr, svelte, hot-module-replacement
Modular Css
A streamlined reinterpretation of CSS Modules via CLI, API, Browserify, Rollup, Webpack, or PostCSS
Stars: ✭ 234 (+283.61%)
Mutual labels:  rollup, svelte
heiss
Hot module reloading prototype with native (almost) ES6 modules
Stars: ✭ 22 (-63.93%)
Mutual labels:  hmr, hot-module-replacement
Svelte Template
🚧 An easy-to-use Svelte template! (Svelte + Typescript + Parcel + Express) 2020
Stars: ✭ 88 (+44.26%)
Mutual labels:  hmr, svelte
Svelte Example
🚀 📚 Some examples to test the Svelte Framework
Stars: ✭ 85 (+39.34%)
Mutual labels:  rollup, svelte
Eleventy Starter
ARCHIVED: An Eleventy starting point with Tailwind and Svelte preconfigured.
Stars: ✭ 118 (+93.44%)
Mutual labels:  rollup, svelte
Svite
svelte integration for vite
Stars: ✭ 383 (+527.87%)
Mutual labels:  hmr, svelte
sapper-template-rollup
Starter Rollup template for Sapper apps using postcss, cssnano, tailwindcss, and svelte-preprocess.
Stars: ✭ 32 (-47.54%)
Mutual labels:  rollup, svelte
svelte-multistep-form
Svelte MultiStep Form like, this component is still in beta stage
Stars: ✭ 29 (-52.46%)
Mutual labels:  svelte, svelte-v3
svelte-pwa-now
A PWA ready Svelte v3.0 starter template with Tailwind, Now integration and optional Typescript suppot
Stars: ✭ 138 (+126.23%)
Mutual labels:  rollup, svelte-v3
minimal-hapi-react-webpack
Minimal Hapi + React + Webpack + HMR (hot module reloading) Sandbox
Stars: ✭ 55 (-9.84%)
Mutual labels:  hmr, hot-module-replacement
Sapper Template Firebase
Starter Rollup template for Sapper apps with Firebase functions based on https://github.com/nhristov/sapper-template-rollup.
Stars: ✭ 29 (-52.46%)
Mutual labels:  rollup, svelte
Svelte Tailwind Extension Boilerplate
A Chrome extension boilerplate built with Svelte, TailwindCSS, Jest, and Rollup.
Stars: ✭ 26 (-57.38%)
Mutual labels:  rollup, svelte
Vudash
Powerful, Flexible, Open Source dashboards for anything
Stars: ✭ 363 (+495.08%)
Mutual labels:  rollup, svelte
svelte-color-picker
A color picker component for svelte
Stars: ✭ 96 (+57.38%)
Mutual labels:  svelte, svelte-v3
markushatvan.com
Personal website and blog written from scratch with SvelteKit and TailwindCSS.
Stars: ✭ 82 (+34.43%)
Mutual labels:  rollup, svelte
svelte-credit-card
A svelte component to render a credit card 💳
Stars: ✭ 30 (-50.82%)
Mutual labels:  rollup, svelte
webpack-hmr
🔨Easy implementation of webpack Hot-Module-Replacement(hmr)
Stars: ✭ 120 (+96.72%)
Mutual labels:  hmr, hot-module-replacement
BeatHub
Small, simple, and fast custom beatmap browser & downloader built with Svelte
Stars: ✭ 13 (-78.69%)
Mutual labels:  svelte, svelte-v3

Svelte Template Hot

This is a copy of official Svelte template with added HMR support. It lives at https://github.com/rixo/svelte-template-hot.

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.

⚠️ Experimental ⚠️

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.

Update 2020-02-24 We're making progress :)

NOTE This template pins the minor version of Svelte in package.json, using the tilde comparator because, in practice, HMR breakages tend to only happen with new minor versions of Svelte (not patch). And I don't want people to download a hot template with broken HMR... But, in your app, you can change this to your liking -- because you might be more interested in last version of Svelte than stable 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:

npx degit rixo/svelte-template-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:

npm run build

Quick start

npm run dev

Navigate to localhost:5000. You should see your app running. Edit a component file in src, save it, and... Eyeball!

Usage

HMR is supported both with Nollup or with Rollup itself with (very experimental) rollup-plugin-hot.

Nollup implements the shortest possible path from a file change to the module reloaded in the browser and is all in-memory. Said otherwise, it is insanely fast. Also, it has been around for some time so it is quite battle tested already.

The Rollup plugin on the other hand is still little more than a proof of concept by now, but it has better sourcemap support and error reporting (according to my own tastes at least).

Support for both Nollup and Rollup HMR is provided by rollup-plugin-svelte-hot. Please report issues regarding HMR in this plugin's tracker. Or this template's project might make more sense. You be the judge.

Start HMR server with Nollup

npm run dev:nollup

Start Rollup with HMR support

npm run dev:rollup

Start with LiveReload (no HMR)

This is the default dev of official template.

npm run dev:livereload

Start with default method

Nollup HMR is also aliased as dev so you can simply run:

npm run dev

You can change the default dev script to your preferred method in the scripts section of package.json.

2020-06-29 Nollup has been made the default dev script (instead of Rollup) because just released Nollup 0.12.0 fixes support for Svelte sourcemaps and dynamic imports, and Nollup is monstrously fast (especially on the most important metrics, that is rebuild time in big projects)!

The suggested workflow is to use Nollup for dev and enjoy instant feedback loop. If you need a plugin that doesn't work with Nollup, or if you are in a situation that Nollup makes harder to debug (mainly because of it running your code through eval), you can fallback on npm run dev:rollup (HMR with rollup-plugin-hot). If you have a bug that you suspect might be caused by HMR or HMR code transform, confirm by turning back to npm run dev:livereload.

Build

npm run build
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].