BjornTheProgrammer / bun-plugin-html

A plugin for bun build which allows html entrypoints
MIT License
34 stars 2 forks source link

Expose options for clean-css and html-minifier-terser #9

Closed casselc closed 8 months ago

casselc commented 9 months ago

Stacked with #8

This adds cssOptions and htmlOptions parameters that allow configuration of the underlying minify calls.

BjornTheProgrammer commented 9 months ago

Hey @casselc, really appreciate you adding all these changes! I will definitely merge these changes, but I just want to ask your opinion on a change before I do.

I feel that the naming of the build option makes it a bit hard to know what it is going to do without looking at the documentation. What's your opinion on changing it to something like includeBuildExtension or includeExtension?

casselc commented 9 months ago

Renaming is no problem, do you think filter should be renamed to something like excludeExtension to match? After looking more at how html-minifier-terser works, this PR is still a little rough around the edges. Working on a revision that also exposes the terser config, but trying to make sure I have the different minification scenarios thought through.

BjornTheProgrammer commented 9 months ago

One of my regrets was allowing the name to be filter. I had the same thought of renaming it but am considering not because it would involve a breaking change to projects I know who are using it. Maybe with the significant amount of changes we can consider a 2.0 release which would make this a non issue.

Admittedly I'm a bit concerned about exposing the CSS and HTML options, due to them becoming hard dependencies. But I won't let perfect be the enemy of the good.

Great work overall, love the thought that's going into this! Can't wait for the finished pull request!

BjornTheProgrammer commented 9 months ago

Hey @casselc,

I would love to commit this pull request to the main repository. If you don't have time to finish off this PR I can incorporate it into the main repo and do so myself. I think the changes here would greatly benefit the project.