Because file paths on windows use the backslash character as a path separator, and the generateSRIHashesModule
function concatenates the path of pages directly as a string in the perPageSriHashes
part of the file it generates, the end result contains invalid strings, because the backslashes need to be escaped:
This could be fixed by escaping the paths before concatenating them into the end result, with a function like below. I can submit a PR if you like.
/**
* @param {string} s
* @returns {string}
*/
const escapeJsonString = (s) => {
if(!s) return s
const json = JSON.stringify(s)
return json.substring(1, json.length - 1)
}
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too