simplabs/ember-hbs-minifier

Name: ember-hbs-minifier

Owner: simplabs

Description: Stripping whitespace out of your Handlebars templates

Created: 2017-01-11 21:57:37.0

Updated: 2018-03-22 21:14:01.0

Pushed: 2018-03-15 16:12:44.0

Homepage:

Size: 173

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

ember-hbs-minifier

Stripping whitespace out of your Handlebars templates

Disclaimer: This is an experiment and might change in the future. Do not use this for production yet unless you understand the consequences!

Installation
r install ember-hbs-minifier
Usage

ember-hbs-minifier will remove unnecessary text nodes from your templates and collapse whitespace into single space characters. This is all done automatically for you (without having to use e.g. {{~foo~}}) but is disabled for certain situations:

Please note that this does not work across component/template boundaries.

What happens in particular is:

Configuration

If you want to disable the whitespace stripping behavior for other tags, components, or elements with certain CSS classes you can adjust the default configuration in your ember-cli-build.js file:

t app = new EmberApp({
'ember-hbs-minifier': {
  skip: {
    classes: [],
    // skip whitespace stripping in `<pre></pre>` tags
    elements: ['pre'], 
    // skip whitespace stripping in `{{#no-minify}}{{/no-minify}}` blocks
    components: ['no-minify'],
  },
},
;
License

ember-hbs-minifier is developed by and © simplabs GmbH and contributors. It is released under the MIT License.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.