0.0.1 • Published 7 years ago

handlebars-compile-loader v0.0.1

Weekly downloads
1
License
ISC
Repository
github
Last release
7 years ago
npm install --save-dev handlebars-compile-loader

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');

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'.