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

Created on 7 Jun 2019  路  14Comments  路  Source: preactjs/preact-cli


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
discussion help wanted

Most helpful comment

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

All 14 comments

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?

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

gotcha

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

Open to a PR

This is fixed in #884

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

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.

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

When do you plan to release this fix?

image

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.

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

"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.

Ok, no problem, here it is #1477

Was this page helpful?
0 / 5 - 0 ratings