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

refactor: code cleanup and support for css files in manifest #257

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

pcfreak30
Copy link

It seems css files do not get processed at ALL.

So I did a code cleanup and I had it support css files by collecting any found in the graph/tree and any in module ID's. However none may be in the graph, and I found something is manipulating the CSS assets so the filenames change.

In my case I have a generated css asset but a moduleId reference in a js file to tailwind.css.

Since there is a relational disconnect I did the best thing I could and collected all found css files and added them to any export that was found to have a css file in its moduleId list.

This works well enough for now to ensure its added to the manifest for my purposes.

If anyone knows how to do better, I welcome feedback b/c I couldn't find the data in the vite graph data.

@pcfreak30 pcfreak30 force-pushed the css-support branch 2 times, most recently from 53364af to 1aecbca Compare February 14, 2025 23:02
Copy link
Collaborator

@gioboa gioboa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @pcfreak30 for your help. I'll look at it in the next days

@pcfreak30
Copy link
Author

Due to further experimenting, I now just have every css asset be added to every export. the metadata is not properly there to track it otherwise.

@zhangHongEn
Copy link
Contributor

Manifest is just preloading, it is just auxiliary, this is why css is not effective

if (/\.css$/.test(source)) return;

@zhangHongEn
Copy link
Contributor

Please try to comment this line of code to see if it works properly

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 this pull request may close these issues.

3 participants