Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minify Templates based on a white list #14

Merged
merged 4 commits into from
Mar 14, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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