-
Notifications
You must be signed in to change notification settings - Fork 916
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: implement html minifier #1015
feat: implement html minifier #1015
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/pikapkg/snowpack/fmbdjqo81 [update for 9ab1562 canceled] |
Awesome! I love this. Happy to merge this, but would you mind adding an option to the webpack plugin to configure this behavior? That way someone can not only customize it, but also disable it if it gives them errors plugins: [
[
"@snowpack/plugin-webpack",
{
htmlMinifierOptions: false // disabled entirely
}
]
] plugins: [
[
"@snowpack/plugin-webpack",
{
htmlMinifierOptions: {
// custom options:
collapseWhitespace: true,
removeComments: true,
removeEmptyAttributes: true,
removeRedundantAttributes: true,
removeScriptTypeAttributes: true,
removeStyleLinkTypeAttributes: true,
}
}
]
] Also be sure to add:
Edit: changed the example to allow for configuration as well as disabling |
Co-authored-by: Gregor Martynus <[email protected]>
Co-authored-by: Gregor Martynus <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks 👍🏼
Awesome! Thanks so much for listening to feedback. This is looking good—just have one question before we merge on whether this is still able to be disabled. |
Co-authored-by: Gregor Martynus <[email protected]>
Changes
Minify HTML output of @snowpack/plugin-webpack.
Testing
Tested locally.