Html-webpack-plugin: No output building template with webpack-dev-server

Created on 15 Jul 2016  路  2Comments  路  Source: jantimon/html-webpack-plugin

I'm using a pug/jade template for index.html. If I have an empty build directory, run webpack-dev-server (which handles processing the template), there's no index.html actually output to the build directory. An abbreviated version of my webpack.config.js is below.

const config = {
  entry: 'client/index.jsx',
  output: {
    path: 'build',
    filename: 'bundle.js'
  },
  module: {
    loaders: [
      {
        test: /\.jsx?$/,
        loader: 'react-hot!babel',
        exclude: /node_modules/
      },
      {
        test: /\.pug$/,
        loader: 'jade'
      }
    ]
  },
  plugins: [
    new HtmlWebpackPlugin({
      filename: 'build/index.html',
      template: 'index.pug',
      cache: false
    }),
  ],
  devServer: {
    contentBase: OUTPUT_PATH,
  }
};

This config file works just fine if I run webpack directly. It's when I run webpack-dev-server that nothing is output.

Most helpful comment

Nevermind. I found the harddisk plugin which solves this exact problem.

All 2 comments

Nevermind. I found the harddisk plugin which solves this exact problem.

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

var-bp picture var-bp  路  3Comments

GerkinDev picture GerkinDev  路  3Comments

lonelyclick picture lonelyclick  路  3Comments

amorphius picture amorphius  路  3Comments

mmjamal picture mmjamal  路  3Comments