mirror of
https://github.com/GoogleChromeLabs/squoosh.git
synced 2025-11-13 01:07:18 +00:00
_headers & _redirects generation (#240)
* Generate `_headers` and `_redirects` by passing assets through ejs templates. * PR feedback * Excluding service worker stuff from prerender * Build SW in dev * Let's give this a try * lol * Is this how it works?
This commit is contained in:
committed by
Jake Archibald
parent
9b572f9541
commit
6994cc3d15
@@ -42,6 +42,9 @@ async function updateReady(reg: ServiceWorkerRegistration): Promise<void> {
|
||||
|
||||
/** Set up the service worker and monitor changes */
|
||||
export async function offliner(showSnack: SnackBarElement['showSnackbar']) {
|
||||
// This needs to be a typeof because Webpack.
|
||||
if (typeof PRERENDER === 'boolean') return;
|
||||
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
navigator.serviceWorker.register('../sw');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user