-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
[docs] update html-minifier docs #3492
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
Conversation
|
✔️ Deploy Preview for kit-demo canceled. 🔨 Explore the source changes: 4d028c8 🔍 Inspect the deploy log: https://app.netlify.com/sites/kit-demo/deploys/61ec0130c395f30008d7922d |
I kinda wonder if we should implement a const response = await resolve(request, {
transformPage: ({ html }) => minify(html, minification_options)
}); Creating a duplicate response feels a bit wasteful |
That feels like a little bit of a confusing and niche API for this. What would it get passed besides |
It is a bit verbose currently. I also wonder if it'd be a big niche to offer a helper. I do think if we were going to offer a helper it should allow you to override more than just the body such as:
|
It would be purely for manipulating rendered pages. This line...
const html = options.transformPage(options.template({ head, body, assets })); There are other reasons you might want to manipulate the HTML, like replacing |
We should merge this PR as-is anyway. I don't want to rush into an API for a new feature because it's holding up a fix in the docs about how the system currently works. |
I've opened #3511 |
closes #3488