Skip to content
This repository has been archived by the owner on Oct 19, 2023. It is now read-only.

Commit

Permalink
Add documentation for compiler options #29
Browse files Browse the repository at this point in the history
  • Loading branch information
esamattis committed Sep 23, 2014
1 parent 0418cc1 commit f8bf122
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,17 @@ might also be used with the `-c` or `--compiler` option, like so:
By default the precompiler is the [handlebars](https://www.npmjs.org/package/handlebars) node module
and the compiler is `"require('hbsfy/runtime')"`.

Options for the precompiler can be passed using a `precompilerOptions` key.

Example:

Enable `myUltimateHelper` only

browserify --precompilerOptions [ --knownHelpersOnly --knownHelpers [ --myUltimateHelper ] ] main.js > bundle.js

See [Handlebars API reference](http://handlebarsjs.com/reference.html) for
details.

## package.json

Transform can be configured from the package.json too.
Expand All @@ -65,7 +76,16 @@ Transform can be configured from the package.json too.
{
"browserify": {
"transform": [
["hbsfy", { "extensions": ["html"] }]
["hbsfy", {
"extensions": ["html"]
"precompilerOptions": {
"knownHelpersOnly": true,
"knownHelpers": {
"myUltimateHelper": true
}
}
}
]
]
}
}
Expand Down

0 comments on commit f8bf122

Please sign in to comment.