Skip to content

Commit

Permalink
Refactor: Enable Prefresh by Default (#1772)
Browse files Browse the repository at this point in the history
* refactor: Enables HMR via Prefresh by default

* docs: Adding changeset

* test: Updating tests to reflect changes to templates
  • Loading branch information
rschristian committed Jan 11, 2023
1 parent f546647 commit 21bbebb
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 11 deletions.
5 changes: 5 additions & 0 deletions .changeset/lucky-lizards-drive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'preact-cli': major
---

HMR / the `--refresh` flag is now enabled by default in dev mode.
2 changes: 1 addition & 1 deletion packages/cli/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ prog
.option('--clear', 'Clears the console when the devServer updates', true)
.option('--sw', 'Generate and attach a Service Worker')
.option('--babelConfig', 'Path to custom Babel config', '.babelrc')
.option('--refresh', 'Enables experimental prefresh functionality', false)
.option('--refresh', 'Enables HMR with Prefresh', true)
.option(
'--template',
'Path to custom HTML template (default "src/template.html")'
Expand Down
20 changes: 10 additions & 10 deletions packages/cli/tests/images/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ exports.default = {
'ssr-build/ssr-bundle.css': 2346,
'ssr-build/ssr-bundle.css.map': 3603,

'bundle.448c6.js': 21563,
'bundle.448c6.js.map': 86009,
'bundle.448c6.legacy.js': 22586,
'bundle.448c6.legacy.js.map': 107151,
'bundle.5be14.js': 21563,
'bundle.5be14.js.map': 86009,
'bundle.5be14.legacy.js': 22586,
'bundle.5be14.legacy.js.map': 107151,
'bundle.6329a.css': 1173,
'bundle.6329a.css.map': 2165,

Expand All @@ -32,12 +32,12 @@ exports.default = {
'preact_prerender_data.json': 11,
'asset-manifest.json': 1686,

'route-home.chunk.45dcd.js': 1179,
'route-home.chunk.45dcd.js.map': 3814,
'route-home.chunk.45dcd.legacy.js': 1222,
'route-home.chunk.45dcd.legacy.js.map': 4452,
'route-home.chunk.b1385.css': 838,
'route-home.chunk.b1385.css.map': 1406,
'route-home.chunk.e8f16.js': 1179,
'route-home.chunk.e8f16.js.map': 3814,
'route-home.chunk.e8f16.legacy.js': 1222,
'route-home.chunk.e8f16.legacy.js.map': 4452,
'route-home.chunk.d116e.css': 838,
'route-home.chunk.d116e.css.map': 1406,

'route-profile.chunk.7a48e.js': 3165,
'route-profile.chunk.7a48e.js.map': 12464,
Expand Down
1 change: 1 addition & 0 deletions packages/create-cli/tests/images/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const path = require('path');
exports.default = [
'.gitignore',
'package.json',
'preact.config.js',
'README.md',
'src/assets/favicon.ico',
'src/assets/icons/android-chrome-192x192.png',
Expand Down

0 comments on commit 21bbebb

Please sign in to comment.