Skip to content

DudaGod/webpack-handlebars-precompiler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

webpack-handlebars-precompiler

A webpack plugin to precompile handlebars templates, partials and helpers into one concatenated file

Installation

npm i webpack-handlebars-precompiler --save-dev

Usage

Example

const HandlebarsPrecompiler = require('webpack-handlebars-precompiler');

module.exports = {
    ...
    plugins: [
        new HandlebarsPrecompiler({
            precompileOpts: {preventIndent: true},
            templatesPath: path.join(__dirname, 'templates'),
            templatesExt: '.hbs',
            helpersPath: path.join(__dirname, 'helpers'), // optional
            outputFile: path.join(__dirname, 'some/folder/bundle.js')
    })
  ]
  ...
}

About

A webpack plugin to precompile handlebars templates, partials and helpers

Resources

Stars

Watchers

Forks

Packages

No packages published