mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 11:35:04 +01:00
log swSource as build fails in CI
This commit is contained in:
parent
23e0d3f2ff
commit
9a82f88e1f
@ -100,14 +100,14 @@ function replaceCacheFilenamesInServiceWorker(swChunk, unhashedFilenames, assets
|
|||||||
const replaceArrayInSource = (name, value) => {
|
const replaceArrayInSource = (name, value) => {
|
||||||
const newSource = swSource.replace(`${name} = []`, `${name} = ${JSON.stringify(value)}`);
|
const newSource = swSource.replace(`${name} = []`, `${name} = ${JSON.stringify(value)}`);
|
||||||
if (newSource === swSource) {
|
if (newSource === swSource) {
|
||||||
throw new Error(`${name} was not found in the service worker source`);
|
throw new Error(`${name} was not found in the service worker source: ` + swSource);
|
||||||
}
|
}
|
||||||
return newSource;
|
return newSource;
|
||||||
};
|
};
|
||||||
const replaceStringInSource = (name, value) => {
|
const replaceStringInSource = (name, value) => {
|
||||||
const newSource = swSource.replace(new RegExp(`${name}\\s=\\s"[^"]*"`), `${name} = ${JSON.stringify(value)}`);
|
const newSource = swSource.replace(new RegExp(`${name}\\s=\\s"[^"]*"`), `${name} = ${JSON.stringify(value)}`);
|
||||||
if (newSource === swSource) {
|
if (newSource === swSource) {
|
||||||
throw new Error(`${name} was not found in the service worker source`);
|
throw new Error(`${name} was not found in the service worker source: ` + swSource);
|
||||||
}
|
}
|
||||||
return newSource;
|
return newSource;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user