Open
Description
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)
}
Activity