@sparkbox/if-prod

A hbs helper that renders a block if NODE_ENV is production.


Keywords
hbs, helper, prod, env
License
ISC
Install
npm install @sparkbox/if-prod@0.1.1

Documentation

ifProd

CircleCI

A hbs helper that renders a block if NODE_ENV=production.

Usage

Register the partial with handlebars, typically like this:

const hbs = require('handlebars');
const ifProd = require('@sparkbox/if-prod');

hbs.registerHelper('ifProd', ifProd);

Once registered the helper will be available to use in any hbs file like so:

{{#ifProd}}
  <script src="src/prod-script.js"></script>
{{/ifProd}}