preact-cli
preact-cli copied to clipboard
GH-591 fix sw being loaded from CDN
trafficstars
What kind of change does this PR introduce? Bug Fix, this will close #591
- refactored entry.js to use
process.env.SW_PATHinstead 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
I am still thinking if adding one more flag is the right thing to do here or can we handle it differently
Can't this just always use __webpack_public_path__? It defaults to "/".
I guess people would sometimes like to build the app for a subfolder? like /shop?