preact-cli icon indicating copy to clipboard operation
preact-cli copied to clipboard

sw-debug.js script is registering even if --sw=false in development mode

Open Panya opened this issue 7 years ago • 14 comments

Do you want to request a feature or report a bug? bug

What is the current behaviour? I'm using preact watch --sw false command but sw-debug.js script is still trying to register as service worker.

What is the expected behaviour? no sw-debug.js service worker when --sw false is passed.

Please mention other relevant information.

  • Node version 10.15.3
  • npm version 6.4.1
  • Operating system Mac OS 10.14.6
  • CLI version 3.0.0-rc.2
  • Browser Chrome 74

Panya avatar Jun 06 '19 23:06 Panya

it really a no-op service worker thats installed only during preact watch to help you tell where you can use what APIs of SW.

does that seem confusing?

prateekbh avatar Jun 06 '19 23:06 prateekbh

Oh, I see, but I prefer not to include the sw if sw=false.

Panya avatar Jun 07 '19 00:06 Panya

gotcha

prateekbh avatar Jun 07 '19 00:06 prateekbh

I guess we might want to add the option to watch as well

Open to a PR

ForsakenHarmony avatar Jun 29 '19 22:06 ForsakenHarmony

https://github.com/preactjs/preact-cli/pull/884

psabharwal123 avatar Sep 08 '19 04:09 psabharwal123

This is fixed in #884

reznord avatar Mar 21 '20 07:03 reznord

registers sw-debug.js when I build with preact build --no-sw

DenizBasgoren avatar Aug 01 '20 15:08 DenizBasgoren

Same issue for me still. sw-debug.js is still included in the build folder when running preact build --no-sw. Using preact-cli version 3.0.1.

Haugen avatar Sep 14 '20 17:09 Haugen

strange, I dont see it being included in the build in our project

psabharwal123 avatar Sep 14 '20 22:09 psabharwal123

When do you plan to release this fix?

image

RonnyLV avatar Nov 30 '20 10:11 RonnyLV

When do you plan to release this fix?

image

What fix are you referring to?

Also, --inline-css and --no-brotli can be removed from your command. CSS is inlined by default, and brotli is disabled by default. The flags have no effect with your usage.

rschristian avatar Dec 01 '20 06:12 rschristian

When do you plan to release this fix? image

What fix are you referring to?

Also, --inline-css and --no-brotli can be removed from your command. CSS is inlined by default, and brotli is disabled by default. The flags have no effect with your usage.

I'm referring to the fix regarding sw-debug.js being included in the build output

RonnyLV avatar Dec 01 '20 07:12 RonnyLV

"The fix" was released back on Sept 7, 2019. If there was a regression you should open a new issue. I'll try to take a look at it tomorrow.

rschristian avatar Dec 01 '20 07:12 rschristian

Ok, no problem, here it is #1477

RonnyLV avatar Dec 01 '20 08:12 RonnyLV