Matching template files
Option: test
Type: RegExp
Default: Engine-dependent.
Defines a regular expression for matching template files that should be treated as entry points.
Default Behavior
Depends on the preprocessor configuration.
Specifying a preprocessor as a supported templating engine automatically assigns
a corresponding file type pattern to the test option.
Supported Preprocessors & Default Patterns:
eta-/\.(html|eta)$/i- Defaultejs-/\.(html|ejs)$/ihandlebars-/\.(html|hbs|handlebars)$/inunjucks-/\.(html|njk)$/ipug-/\.(pug|jade)$/itempura-/\.(html|hbs|tmpr)$/itwig-/\.(html|twig)$/i
Examples
Preprocessor configuration:
new HtmlBundlerPlugin({
preprocessor: 'ejs', // test: /\.(html|ejs)$/i
}),
Custom pattern:
new HtmlBundlerPlugin({
test: /\.ejs$/i
preprocessor: 'ejs',
}),