Skip to content

Dinistro/handlebars-compile-loader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Handlebars compile Loader

Install

npm install --save-dev handlebars-compile-loader

Usage

Use handlebars-compile-loader if you want to offlinecompile your handlebars files.

Via webpack config

webpack.config.js

module.exports = {
  module: {
    rules: [
      {
        "test": /\.hbs$/,
        "loader": {
          "loader": "handlebars-compile-loader",
          "options": {
            partials: './src/assets/partials/**/*.hbs',
            helpers: './src/assets/helpers/*.js',
            data: './src/assets/data/**/*.{js,json}'
          }
        }
      }   
    ]
  }
}

In your application

var template = require('./template.hbs');

Options

You can pass any handlebars-wax options to handlebars-compile-loader via loader options or query parameters.

For available options, look in the 'handlebars-wax documentation'.

About

A webpack loader which already compiles the handlebars files to html

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published