Repository navigation
fix(theme): ship component scripts as files, not inline - #11
Merged
Merged
Conversation
The site Worker sends Content-Security-Policy: script-src 'self', and Astro inlines a component <script> under 4 KB. The lens hero's script (~3 KB) was inlined on the live home page and blocked, so the lens stood still. Scripts now always ship as files under /_astro; other assets keep Astro's default. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Madraka <8898640+Madraka@users.noreply.github.com>
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
cloudhal-com-site | cc0fb62 | Oct 21 2026, 08:23 PM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The live site Worker sends
Content-Security-Policy: script-src 'self'. Astro inlines a component<script>smaller than 4 KB, and the lens hero's script is about 3 KB. On the live home page it was inlined, the browser blocked it (console: "Executing inline script violates … script-src 'self'"), and the lens stood still. It was static but not broken.vite.build.assetsInlineLimitis now a function that returnsfalsefor.js, so scripts always ship as files under/_astro/. Other assets keep Astro's default.Checked with a
CLOUDHAL_TARGET=cloudflare astro build: the script is emitted asdist/client/_astro/LensHero.astro_astro_type_script_index_0_lang.*.js, and no inline lens code is left in the server bundle.🤖 Generated with Claude Code