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
1 changed files with 16 additions and 9 deletions

View File

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