minify icon indicating copy to clipboard operation
minify copied to clipboard

The CLI is missing the TemplateDelims option, which should support specifying multiple TemplateDelims.

Open jmgaooo opened this issue 8 months ago • 1 comments

  1. The TemplateDelims option is currently only available when used as a library; we hope to add it as a CLI parameter.
  2. When using libraries like Vue within Go's HTML templates, there are two types of Delims, and we would like to support configuring multiple TemplateDelims.

jmgaooo avatar Apr 13 '25 16:04 jmgaooo

Thanks for the suggestion. The CLI tool is supposed to automatically discover file formats and set the delimiters automatically. I'm not sure what the mimetype for Vue template file is (text/x-vue-template?), but then you can set the mimetype explicitly in the CLI, or map your custom file extension to the mimetype of a template: minify --ext {vue:text/x-template} input -o output

Regarding supporting multiple delimiters, as I implemented the current feature I knew this would be a problem possibly. I'm not sure how to solve that cleanly.

tdewolff avatar Apr 28 '25 15:04 tdewolff