# parcel-plugin-handlebars-mock **Repository Path**: mirrors_bamlab/parcel-plugin-handlebars-mock ## Basic Information - **Project Name**: parcel-plugin-handlebars-mock - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-02-25 - **Last Updated**: 2026-05-23 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # @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: ```js 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 ```js const Handlebars = require('handlebars'); Handlebars.registerHelper('isArrayBig', (array) => { return array.length > 3; }); ```