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

feat: minify HTML output #139

Closed
wants to merge 2 commits into from

Conversation

IGassmann
Copy link

This minifies the resulting HTML with rehype-preset-minify. Without it, the HTML output of MDX content is un-minified which results in larger payloads.

Motivation

I'm currently trying to migrate my personal website to MDXTS. My website has a RSS JSON Feed that is generated with the help of cheerio. The un-minified content would cause the JSON feed to have undesirable \n characters that mess up the HTML rendering in RSS readers..

Copy link

changeset-bot bot commented May 29, 2024

⚠️ No Changeset found

Latest commit: 050a7de

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

vercel bot commented May 29, 2024

@IGassmann is attempting to deploy a commit to the souporserious Team on Vercel.

A member of the Team first needs to authorize it.

@souporserious
Copy link
Owner

Thank you for the PR! I understand the concern for the final output, but I don't want to add this package right now since rehype-preset-minify has 24 additional dependencies and I've been trying to keep the overall dependencies in this library stable since they are already quite large.

I've been thinking about exposing a way to override remark and rehype plugins which would allow you to pass this particular plugin yourself. However, allowing arbitrary plugins could break existing MDXTS functionality so I've been cautious about exposing that ability. If you can make use of the MDXContent component that does allow you to pass custom plugins.

@IGassmann IGassmann deleted the minify-html-output branch June 2, 2024 13:40
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.

None yet

2 participants