@sparkbox/if-prod

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

Usage no npm install needed!

<script type="module">
  import sparkboxIfProd from 'https://cdn.skypack.dev/@sparkbox/if-prod';
</script>

README

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}}