diff2html/website/templates/helpers/partial.js
biodiscus 818f752714 optimize webpack config for faster build website
- switch to modern html-bundler-webpack-plugin
- replace deprecated `file-loader` and `url-loader` with Webpack 5 assets module
- create single webpack config instead of two configs
2023-09-03 12:00:59 +02:00

20 lines
471 B
JavaScript

'use strict';
/** @typedef {import('handlebars').HelperOptions} HelperOptions */
/**
* @param {string} name
* @param {HelperOptions} options
* @return {void}
*/
module.exports = function (name, options) {
// don't modify `this` in code directly, because it will be compiled in `exports` as an immutable object
// eslint-disable-next-line
const context = this;
if (!context._blocks) {
context._blocks = {};
}
context._blocks[name] = options.fn;
};