mirror of
https://github.com/LukeHagar/sveltekit-electron-adapter.git
synced 2025-12-07 12:47:49 +00:00
[Options] Policy
This commit is contained in:
15
index.js
15
index.js
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user