kilokeith / pug-static-loader

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Pug HTML loader for webpack

Installation

npm install pug-html-loader

Usage

In your sources:

var html = require('./file.pug')
// => returns file.pug content as html compiled string

In your webpack.config.js file:

module.exports = {
  // your config settings ...
  module: [
    // your modules...
    loaders: [{
      include: /\.pug/,
      // pass options to pug as a query ('pug-html-loader?pretty')
      loader: 'pug-html-loader'
    }]
  ]
};

Don't forget to polyfill require if you want to use it in node. See webpack documentation.

License

MIT (http://www.opensource.org/licenses/mit-license.php)

About


Languages

Language:JavaScript 100.0%