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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improving debugging for relativeCSSInjection #116

Closed
grumd opened this issue Sep 20, 2023 · 1 comment · Fixed by #117
Closed

Improving debugging for relativeCSSInjection #116

grumd opened this issue Sep 20, 2023 · 1 comment · Fixed by #117

Comments

@grumd
Copy link
Contributor

grumd commented Sep 20, 2023

When using relativeCSSInjection, cssCodeSplit needs to be enabled. This is not documented and unfortunately I didn't know that until I opened the source code of this plugin.

I was using build.lib option, so in my configuration build.cssCodeSplit was undefined, and Vite by default sets it to false after resolving configs.

image

This plugin only checks if (config.build.cssCodeSplit == false) before sending out a warning.

My suggestions:

  1. Can configResolved(_config) be used for this check? It doesn't have env.command but it will have the resolved false value for cssCodeSplit after Vite decides on the defaults.
  2. We could also change the condition to if (config.build.cssCodeSplit == false || (!config.build.cssCodeSplit && config.build.lib)) but I don't really like that. Vite could change their defaults at any time.
  3. Add the information about cssCodeSplit to the readme. I'll send a PR for that shortly.
@marco-prontera
Copy link
Owner

Hi, thank you for the issue.
I think it's a good starting point the PR you proposed.
I will merge it asap, thank you for the contribution.
I will valuate others solutions you proposed, but for know I think it's enough

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants