Parcel plugin to populate html during development.
npm install @bam.tech/parcel-plugin-handlebars-mockPopulate HTML file with mock data in development.
It also let you register helper methods for handlebars
yarn add @bam.tech/parcel-plugin-handlebars-mock
- 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:
``js`
module.exports = {
bar: 'baz',
};
- If NODE_ENV is production, then the plugin is not applied.
- create a src/helper directory with an index.js that register some templates
`js
const Handlebars = require('handlebars');
Handlebars.registerHelper('isArrayBig', (array) => {
return array.length > 3;
});
``