The method written in spike-records fails:
test: /\.pug$/,
use: [{
loader: 'pug-static-loader',
options: {
pretty: true,
locals: () => locals
}
}]
Error:
ModuleBuildError: Module build failed: ValidationError: child "locals" fails because ["locals" must be an object]