[Options] Policy

This commit is contained in:
Patryk Rzucidlo (PTKDev)
2023-02-09 22:10:51 +01:00
parent ca90c1dcc3
commit d7a4a3789f
2 changed files with 22 additions and 6 deletions

View File

@@ -114,6 +114,21 @@ See https://kit.svelte.dev/docs/page-options#prerender for more details`
});
});
let regex_input = new RegExp(
`http-equiv="content-security-policy" content=""`,
"g"
);
const policy = "";
let regex_replace = `http-equiv="content-security-policy" content="${
options?.policy ? options.policy : policy
}"`;
await replace.sync({
files: [pages + "/**/*.html"],
// @ts-ignore
processor: (input) => input.replace(regex_input, regex_replace),
});
const HTML_assets = await glob("_app/**/*", {
cwd: pages,
dot: true,