How to stop Webpack minifying HTML?

This issue may help you.

loaders: [
    {
      test: /\.pug$/,
      exclude: /(node_modules)/,
      loader: "pug-html",
      query: {
        pretty: true
      }
    }
  ]

There's an option for html-webpack-plugin. minify: false. Have you tried adding that?

https://github.com/jantimon/html-webpack-plugin#configuration


Below command works for both npm run dev and npm run prod

    module: {
        rules: [{
            test: /\.pug$/,
            use: [
                'html-loader?minimize=false', 
                'pug-html-loader?pretty=true'
            ]
        }]
    },

Tags:

Webpack