Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
Turbo87 committed Mar 14, 2018
1 parent 46dd8d9 commit 28a4c30
Showing 1 changed file with 27 additions and 19 deletions.
46 changes: 27 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,28 +18,15 @@ 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~}}`).
automatically for you (without having to use e.g. `{{~foo~}}`) but is
disabled for certain situations:

- Inside of `<pre></pre>` tags

Here is the default configuration.
- Inside of `{{#no-minify}}{{/no-minify}}` blocks
(these will be stripped from the template)

#### ember-cli-build.js
```javascript

'ember-hbs-minifier': {
skip: {
classes: [],
elements: ['pre'], //Inside of `<pre></pre>` tags are skipped.
components: ['no-minify'] //Inside of `{{#no-minify}}{{/no-minify}}` blocks are skipped. You can provide your own config here say, contact-details, 'address-section'
}
}
```

Note:

- This does not work across component/template boundaries.

- `no-minify` wrappers are stripped from the template.
Please note that this does not work across component/template boundaries.

What happens in particular is:

Expand All @@ -50,6 +37,27 @@ What happens in particular is:
containing only whitespace are removed entirely


### 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:

```javascript
let 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
------------------------------------------------------------------------------

Expand Down

0 comments on commit 28a4c30

Please sign in to comment.