Skip to content

Commit

Permalink
Merge pull request #14 from siva-sundar/patch_hbs_minify_config
Browse files Browse the repository at this point in the history
Minify Templates based on a white list
  • Loading branch information
Turbo87 authored Mar 14, 2018
2 parents 8f3d22a + acdbf90 commit 46dd8d9
Show file tree
Hide file tree
Showing 14 changed files with 2,183 additions and 848 deletions.
25 changes: 19 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,28 @@ 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:
automatically for you (without having to use e.g. `{{~foo~}}`).

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

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

Note that this does not work across component/template boundaries.
#### 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.

What happens in particular is:

Expand Down
Loading

0 comments on commit 46dd8d9

Please sign in to comment.