- 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
20 lines
471 B
JavaScript
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;
|
|
};
|