Skip to content

v3.0.0

Compare
Choose a tag to compare
@webdiscus webdiscus released this 17 Jul 16:09
· 56 commits to master since this release

⚠ BREAKING CHANGES

  • Drop support for Node 12, minimum supported version is 14.18

    • Node 12 is End-of-Life.
    • Actual version of sass-loader 13.x requires Node 14.
  • Defaults the embedded CSS extractor module is now enabled.
    For compatibility with external extractor, you can disable extractCss module:

new PugPlugin({
  extractCss: {
    enabled: false, // disable embedded extractCss module to bypass extracting via external plugin
  },
}),

⚠ DEPRECATION

Definition of PugPlugin.extractCss as plugin module is deprecated because this module is enabled by default.
Following definition is deprecated:

new PugPlugin({
  modules: [
    PugPlugin.extractCss({
      filename: 'assets/css/[name].[contenthash].css',
    })
  ],
}),

Now use the new extractCss option to configure the embedded CSS extractor module:

new PugPlugin({
  extractCss: {
    filename: 'assets/css/[name].[contenthash].css',
  },
}),

Features

  • add support auto publicPath
  • add extractCss option for embedded CSS extract module
  • defaults, the extractCss module is enabled with default options
  • improved resolving of assets
  • display the error message on broken page due to fatal error
  • add supports for pug filters :escape, :code, :highlight and :markdown
  • add supports for module type asset/inline the inline SVG in HTML and data-URL for binary images
  • add supports for module type asset/inline the utf8 encoding for SVG data-URL in CSS
  • add supports for module type asset to automatically choose between resource and inline
  • add supports for zero config,
    it means, that w/o any plugin options the pug and style modules will be processed with default options.
    Zero config new PugPlugin() is equivalent to:
    new PugPlugin({
      test: /\.(pug)$/,
      enabled: true,
      verbose: false,
      pretty: false,
      sourcePath: null,
      outputPath: null,
      filename: '[name].html',
      extractCss: {
        test: /\.(css|scss|sass|less|styl)$/,
        enabled: true,
        verbose: false,
        filename: '[name].css',
        sourcePath: null,
        outputPath: null,
      },
      modules: [],
    }),