withastro / astro

The web framework for content-driven websites. ⭐️ Star to support our work!
https://astro.build
Other
46.76k stars 2.48k forks source link

InlineStylesheets: 'never' is invalid for the styles and scripts generated by Astro islands #12395

Open shiheme opened 6 days ago

shiheme commented 6 days ago

Astro Info

build: {
    inlineStylesheets: "always",
  },

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

I used inline Stylesheets: 'never', which seems to be ineffective for the styles and scripts generated by Astro islands. There is still a lot of code appearing on the current page

What's the expected result?

Is there a solution to prevent the page from having a lot of introverted styles and scripts?

Link to Minimal Reproducible Example

https://stackblitz.com/edit/2014-test-astro-islands?file=package.json,src%2Fstyles%2Fglobals.css,src%2Flayouts%2FLayout.astro,astro.config.mjs,tsconfig.json,src%2Fcomponents%2Fdemo.jsx,src%2Fpages%2Findex.astro&title=Astro%20Starter%20Kit:%20Basics

Participation

apatel369 commented 6 days ago

@shiheme Please add a valid reproduction link.

shiheme commented 5 days ago

I have added a reproduction link. I am using shadcn/ui to add client: * as an interactive component. Can CSS and JavaScript be stored in one file for reference in the built code? Otherwise, a large amount of code will make people feel that the code is bloated

image