Skip to content

Commit 24a6147

Browse files
committed
fix: Ensuring the sw flag is a boolean in watch mode
1 parent b3b6984 commit 24a6147

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

.changeset/tender-carrots-sniff.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'preact-cli': patch
3+
---
4+
5+
Ensuring the sw flag is a boolean in watch mode

packages/cli/lib/commands/watch.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ const runWebpack = require('../lib/webpack/run-webpack');
22
const { warn } = require('../util');
33
const { validateArgs } = require('./validate-args');
44

5+
const toBool = val => val === void 0 || (val === 'false' ? false : val);
6+
57
const options = [
68
{
79
name: '--src',
@@ -101,6 +103,7 @@ async function command(src, argv) {
101103
}
102104
argv.src = src || argv.src;
103105
argv.production = false;
106+
argv.sw = toBool(argv.sw);
104107

105108
if (argv.https || process.env.HTTPS) {
106109
let { key, cert, cacert } = argv;

0 commit comments

Comments
 (0)