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

Use simpler CSS minify for runtime #381

Merged
merged 4 commits into from
Aug 31, 2024
Merged

Use simpler CSS minify for runtime #381

merged 4 commits into from
Aug 31, 2024

Conversation

yhatt
Copy link
Member

@yhatt yhatt commented Aug 31, 2024

#314 has been pointed out that CSS minifier plugins are depending on the limited context (Node.js). I've been resolved by prebundling critical plugins in #315, but we still received that Marp Core is still incompatible in some JavaScript environments such as Cloudflare Workers, because the prebundled script is still depending on path and utils.

An community fork @syumai/marp-core for making compatible Marp Core with Cloudflare Workers is actually removing CSS minification. syumai@cc24fcb

For getting rid off Node.js dependency in minifyCSS feature, this PR will replace PostCSS plugin for minify from cssnano plugins into simpler plugin @csstools/postcss-minify. That makes no longer depended on Node.js packages, and no longer required complex prebundling settings. 🙌

Instead, cssMinify will no longer apply minification to CSS selectors and declarations. That is major change, but we do not think that is having major impact because this plugin has consistent gurantees:

It guarantees two things :

  • browsers can not tell the difference between the original and the minified CSS
  • lawyers can not tell the difference between the original and the minified CSS

https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-minify#readme

@yhatt yhatt changed the title Use simpler CSS minify plugin for runtime Use simpler CSS minify for runtime Aug 31, 2024
@yhatt yhatt merged commit d1172d0 into main Aug 31, 2024
1 check passed
@yhatt yhatt deleted the replace-minify-plugins branch August 31, 2024 11:55
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.

1 participant