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

CSS variable name changes every build #41

Open
tonyfromundefined opened this issue Jul 9, 2023 · 8 comments
Open

CSS variable name changes every build #41

tonyfromundefined opened this issue Jul 9, 2023 · 8 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@tonyfromundefined
Copy link

스크린샷 2023-07-09 오후 4 52 06

Therefore, there is a problem that chunk hash keeps changing. due to that issue

  • Unable to use one build for multiple stages
  • Chunk hash keeps changing to reduce cache hit rate every time it is distributed.

I ask for your help so that it can be a definitive build without side effects.

@navanshu
Copy link
Owner

navanshu commented Jul 9, 2023

@tonyfromundefined
If you are looking for a plugin that can work on separate files go to import splitFiles.js, works the same but it doesn't resets the variables.

It is in the description, if it doesn't work please let me know

@navanshu
Copy link
Owner

navanshu commented Jul 9, 2023

It might help, but it based on the order of variable, It doesn't preserve the compression across builds

@navanshu
Copy link
Owner

navanshu commented Jul 9, 2023

@tonyfromundefined I will look into it.

@tonyfromundefined
Copy link
Author

tonyfromundefined commented Jul 10, 2023

It helps! But as you said, it doesn't seem to completely solve the problem... Is there a reason you used the global variable count implementation instead of compressing or hashing the variable names?

@navanshu
Copy link
Owner

Will be releasing update it tomorrow

@navanshu
Copy link
Owner

@tonyfromundefined I used counter since, it is easier and quite efficient, no algorithm can provide such compression

@tonyfromundefined
Copy link
Author

https://github.com/navanshu/postcss-variable-compress#to-utilize-the-history--same-variables-accross-builds-effectively-follow-these-steps

Oh, it seems really smart to codegen the mapping information and cache it in git. It seems like a good idea, so I'm looking forward to it. 👍

It seems to be similar to Persisted Query in GraphQL 😂

@navanshu
Copy link
Owner

@tonyfromundefined 🤣 code-gen for css variables, I can see feel the terror

@navanshu navanshu added this to the v4 milestone Jan 1, 2024
@navanshu navanshu added the enhancement New feature or request label Jan 1, 2024
@navanshu navanshu self-assigned this Jan 1, 2024
Repository owner deleted a comment from devarya Feb 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants