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

GH-591 fix sw being loaded from CDN

Open kencanak opened this issue 5 years ago • 3 comments
trafficstars

What kind of change does this PR introduce? Bug Fix, this will close #591

  • refactored entry.js to use process.env.SW_PATH instead of webpack public path
  • introduced new cli option for setting swPath, default would be /

Did you add tests for your changes? N/A, did a local test though

Summary Service Worker loaded from CDN, see #591 for more details

Does this PR introduce a breaking change?

don't think so

kencanak avatar Jul 16 '20 07:07 kencanak

I am still thinking if adding one more flag is the right thing to do here or can we handle it differently

prateekbh avatar Jul 21 '20 06:07 prateekbh

Can't this just always use __webpack_public_path__? It defaults to "/".

developit avatar Jul 27 '20 18:07 developit

I guess people would sometimes like to build the app for a subfolder? like /shop?

prateekbh avatar Jul 27 '20 18:07 prateekbh