tools.pug

  • Type: true | Object | Function | undefined
  • Default: false

Configure the Pug template engine.

Boolean Type

Pug template engine is not enabled by default, you can enable it by setting tools.pug to true.

export default {
  tools: {
    pug: true,
  },
};

When enabled, you can use index.pug as the template file in html.template config.

Object Type

When tools.terser is Object type, you can passing the Pug options:

export default {
  tools: {
    pug: {
      doctype: 'xml',
    },
  },
};

For detailed options, please refer to Pug API Reference.

Function Type

When tools.pug is Function type, the default configuration is passed in as the first parameter, the configuration object can be modified directly, or a value can be returned as the final result.

export default {
  tools: {
    pug(config) {
      config.doctype = 'xml';
    },
  },
};