@bam.tech/parcel-plugin-handlebars-mock

2.0.1 • Public • Published

@bam.tech/parcel-plugin-handlebars-mock

Populate HTML file with mock data in development. It also let you register helper methods for handlebars

Installation

yarn add @bam.tech/parcel-plugin-handlebars-mock

Usage

Mock data

  • Create a src/mock directory.
  • For each html file (named foo.html for example), create a src/mock/foo.html.js with the mock content:
module.exports = {
  bar: 'baz',
};
  • If NODE_ENV is production, then the plugin is not applied.

Register helper methods

  • create a src/helper directory with an index.js that register some templates
const Handlebars = require('handlebars');

Handlebars.registerHelper('isArrayBig', (array) => {
  return array.length > 3;
});

Readme

Keywords

none

Package Sidebar

Install

npm i @bam.tech/parcel-plugin-handlebars-mock

Weekly Downloads

21

Version

2.0.1

License

MIT

Unpacked Size

1.83 kB

Total Files

5

Last publish

Collaborators

  • thomasre
  • matthieug
  • evej
  • charlotteisambertbam
  • remilry
  • matthieugbam
  • hugok
  • pierrezimmermann
  • pierpo
  • alexisd
  • p0labrd
  • antoine-cottineau
  • laurence923
  • cyrilbo
  • clementtab
  • antoined
  • marekkalnik
  • almouro
  • tychota
  • julienc6
  • minishlink