From 74192e99797ec1529e7c1ca222ee28f6d22b09a0 Mon Sep 17 00:00:00 2001 From: Ryan Christian <33403762+rschristian@users.noreply.github.com> Date: Tue, 10 Jan 2023 20:00:41 -0600 Subject: [PATCH] Refactor: Enable Prefresh by Default (#1772) * refactor: Enables HMR via Prefresh by default * docs: Adding changeset * test: Updating tests to reflect changes to templates --- .changeset/lucky-lizards-drive.md | 5 +++++ packages/cli/src/index.js | 2 +- packages/create-cli/tests/images/create.js | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 .changeset/lucky-lizards-drive.md diff --git a/.changeset/lucky-lizards-drive.md b/.changeset/lucky-lizards-drive.md new file mode 100644 index 000000000..331225065 --- /dev/null +++ b/.changeset/lucky-lizards-drive.md @@ -0,0 +1,5 @@ +--- +'preact-cli': major +--- + +HMR / the `--refresh` flag is now enabled by default in dev mode. diff --git a/packages/cli/src/index.js b/packages/cli/src/index.js index e62d50e19..b64617532 100755 --- a/packages/cli/src/index.js +++ b/packages/cli/src/index.js @@ -55,7 +55,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")' diff --git a/packages/create-cli/tests/images/create.js b/packages/create-cli/tests/images/create.js index aafe85de4..c005114a8 100644 --- a/packages/create-cli/tests/images/create.js +++ b/packages/create-cli/tests/images/create.js @@ -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',