unbroken-dome / indexhtml-webpack-plugin

Index HTML plugin for Webpack
MIT License
42 stars 5 forks source link

Does it work with template engines? #7

Closed arturkin closed 11 months ago

arturkin commented 9 years ago

It would be a good addition to this plugin to work with template engines like jade. I tried jade-html-loader but no luck.

squirmy commented 8 years ago

Thought I'd have a look at this - good news it's possible. :) Instead of using jade-html-loader, use template-html-loader (you also need jade installed).

This is the webpack config that worked for me:

var IndexHtmlPlugin = require('indexhtml-webpack-plugin');

module.exports = {
  entry: {
    "index.html": './src/index.jade',
    main: "./src/main.js"
  },
  output: {
    path: "./build",
    filename: "[name]-[chunkhash].js"
  },
  module: {
    loaders: [
      {
        test: /index\.jade$/,
        loader: 'template-html-loader'
      }
    ]
  },
  plugins: [
    new IndexHtmlPlugin('index.html', 'index.html')
  ]
}
arturkin commented 8 years ago

Thanks, it works but without HMR :(

exdeniz commented 8 years ago

Yes, works. But i want HMR. Please fixed.