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

Migrating to using LightningCSS #238

Merged
merged 11 commits into from
Jan 9, 2024
Merged

Migrating to using LightningCSS #238

merged 11 commits into from
Jan 9, 2024

Conversation

Woedenaz
Copy link
Contributor

@Woedenaz Woedenaz commented Jan 7, 2024

LightningCSS is just faster and replaces a number of PostCSS plugins, making the number of required package installations lower. The resulting minified CSS file is also, theoretically, slightly faster to load compared to the old one. Haven't exactly tested this myself but it should be.

I also made some small changes to a few make files just to make the build process a little more efficient since some commands were being run even when they didn't need to. I'm not exactly the makefile expert so feel free to suggest any better methods if they exist!

LightningCSS has matured a fair bit and can potentially replace many of the items in the postcss toolset. I just need to thoroughly test it to make sure.
I wanted to get this mixin plugin to work with LightningCSS as well but I can't quite figure it out yet.
Added a visitor to the LightningCSS build to ensure the Font URLs in `dist/css/black-highlighter.css` were correct.

Also made some changes to the Makefiles. It checks if the images in `dist` already exist and, if they do, only runs the image optimization if the filesizes are different.

I also added a `touch` to the CSS build since it seemed to be always running those `bun postcss` command but not updating the update time for the output file, for some reason. There's probably a better way to remedy this but it works for now.
@Woedenaz Woedenaz requested a review from emmiegit January 7, 2024 19:10
@Woedenaz
Copy link
Contributor Author

Woedenaz commented Jan 7, 2024

Hmm, genuinely not sure why the build is failing. It says error: Script not found "svgo" but bun svgo has worked just fine in the past. So I'm a little confused there.

build/css.mk Outdated Show resolved Hide resolved
build/css.mk Show resolved Hide resolved
@Woedenaz Woedenaz merged commit 253411b into master Jan 9, 2024
1 check passed
@Woedenaz Woedenaz deleted the LightningCSS-Migration branch January 9, 2024 21:02
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.

2 participants