S
S
s243442018-07-27 14:56:54
webpack
s24344, 2018-07-27 14:56:54

How to make files with four spaces after assembly in webpack?

Guys, tell me, please. I'm using webpack to build. I need the files to be indented: 4 spaces. I have 2.

new HtmlWebpackPlugin({
  filename: 'index.html',
  chunks: ['index', 'common'],
  template: PATH.source + '/pages/index/index.pug'
})

module.exports = function () {
  return {
    module: {
      rules: [
        {
          test: /\.pug$/,
          loader: 'pug-loader',
          options: {
            pretty: true
          }
        }
      ]
    }
  }
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman Sokhin, 2018-08-22
@roamn

Try passing four spaces to the pretty option. According to the documentation , this option must accept either true/false or a string with the required number of indents.
pretty: ' '

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question