webpack: Use cacheLoader for handlebars files.

This seems to save about 1s for run-dev.py startup time.
This commit is contained in:
Tim Abbott
2020-04-30 12:31:23 -07:00
parent af5ba9bf36
commit d0ffba96d9

View File

@@ -109,15 +109,22 @@ export default (env?: string): webpack.Configuration[] => {
}, },
{ {
test: /\.hbs$/, test: /\.hbs$/,
loader: 'handlebars-loader', use: [
options: { cacheLoader,
// Tell webpack not to explicitly require these. {
knownHelpers: ['if', 'unless', 'each', 'with', loader: 'handlebars-loader',
// The ones below are defined in static/js/templates.js options: {
'plural', 'eq', 'and', 'or', 'not', // Tell webpack not to explicitly require these.
't', 'tr', 'rendered_markdown'], knownHelpers: [
preventIndent: true, 'if', 'unless', 'each', 'with',
}, // The ones below are defined in static/js/templates.js
'plural', 'eq', 'and', 'or', 'not',
't', 'tr', 'rendered_markdown',
],
preventIndent: true,
},
},
],
}, },
// load fonts and files // load fonts and files
{ {