ember-cli-htmlbars-minifier
v2.1.0
Published
Removes all whitespace in htmlbars templates
Downloads
617
Readme
ember-cli-htmlbars-minifier
Information
- Ember.js v3.20 or above
- Ember CLI v3.20 or above
- Node.js v10 or above
Install in ember-cli application
In your application's directory:
npm install ember-cli-htmlbars-minifier --save-dev
Configuration
You can choose not to remove certain kinds of whitespace using config options that you can add to your ember-cli-build.js
. If not specified, they default to true.
"htmlbarsMinifier": {
stripIndentation: true,
removeTrailingSpaces: true,
removeSpacesAroundTags: true,
stripNewlines: true,
coalesceSpaces: true
}
| Config Option | Description | | ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | | stripIndentation | Remove any consecutive sets of tabs or spaces from the beginning of each line. | | removeTrailingSpaces | Remove any whitespace that may be at the end of each line. | | removeSpacesAroundTags | Remove any whitespace that occurs before or after an HTML tag or Handlebars tag | | stripNewlines | Remove all newlines from the template (except those that are inside an open tag, which will be ignored by the HTMLBars/Glimmer parser anyway). | | coalesceSpaces | Replace any runs of multiple whitespaces with a single space. |
Contributing
We're thankful to the community for contributing any improvements.
Do not forget to follow our eslint rules and make test for the new functionalities/fixes.
Versioning
We use SemVer for versioning. For the versions available, see the tags on this repository.
Authors
See the list of contributors who participated in this project.
License
This project is licensed under the MIT License - see the LICENSE.md file for details