Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug?]: CSS is not applied on build when Vite build.cssCodeSplit: false option is used #1324

Open
2 tasks done
TrentsPC opened this issue Feb 11, 2024 · 1 comment
Open
2 tasks done
Labels
bug Something isn't working vinxi related to vinxi

Comments

@TrentsPC
Copy link

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Current behavior 馃槸

After building an app with cssCodeSplit: false, a bundled and hashed CSS file is correctly created in the output, but the CSS file is not linked to or referenced by any file in the output.

Expected behavior 馃

The CSS file should be linked on all routes, as if it were included as a <link/> in entry-server.tsx

Steps to reproduce 馃暪

Steps:

  1. Create a SolidStart app using create solid with the basic preset
  2. Update vite.config.ts to:
import { defineConfig } from "@solidjs/start/config";

export default defineConfig({
  build: {
    cssCodeSplit: false,
  },
});
  1. Run the build script
  2. observe that the generated .output/public/_build/assets/style-[hash].css file is not referenced in any generated html or js file

Context 馃敠

I am styling my app by importing different css files on different routes, and I would like to have the option of using cssCodeSplit: false to combine them all and avoid loading new CSS on navigation and causing unnecessary repaints / FOUC

Your environment 馃寧

No response

@TrentsPC TrentsPC added the bug Something isn't working label Feb 11, 2024
@nksaraf nksaraf added the vinxi related to vinxi label Feb 12, 2024
@indeyets
Copy link
Contributor

I recently needed this feature too. It would help me to have a cleaner "critical css" implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working vinxi related to vinxi
Projects
None yet
Development

No branches or pull requests

3 participants