-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Open
Labels
feature / enhancementNew feature or requestNew feature or request
Milestone
Description
Describe the problem
In certain situations it makes sense to externalise inline scripts and styles for CSP purposes (e.g. when building Chrome extensions).
Describe the proposed solution
This only really applies to prerendered pages (there's basically no good way to externalise a dynamically rendered script), so I propose the following interface:
// svelte.config.js
export default {
kit: {
prerender: {
externalise: true
}
}
};
This would override the inlineStyleThreshold
option. (If externalise
isn't descriptive enough, we can bikeshed this.)
This would write out an inline script to the filesystem for each prerendered page, under the appDir
(so the script can be cached immutably).
Alternatives considered
No response
Importance
nice to have
Additional Information
No response
codepainting, ajzbc, GiantRobots, bogacg, riverfr0zen and 5 more
Metadata
Metadata
Assignees
Labels
feature / enhancementNew feature or requestNew feature or request