Skip to content

Latest commit

 

History

History
26 lines (21 loc) · 2.2 KB

plugins.md

File metadata and controls

26 lines (21 loc) · 2.2 KB
title parent nav_order
Plugins Module
Modules
4

Plugins Module

const { plugins } = require( '@humanmade/webpack-helpers' );

This module provides methods which create new instances of commonly-needed Webpack plugins.

  Plugin Description
  plugins.bundleAnalyzer() Create and return a new webpack-bundle-analyzer instance. This plugin is included in production preset builds automatically when the --analyze flag is passed on the command line.
  plugins.clean() Create and return a new clean-webpack-plugin instance.
  plugins.copy() Create and return a new copy-webpack-plugin instance.
  plugins.errorBell() Create and return a new bell-on-bundle-error-plugin instance.
  plugins.eslint() Create and return a eslint-webpack-plugin instance.
  plugins.fixStyleOnlyEntries() Create and return a webpack-remove-empty-scripts instance (forked from the non-Webpack 5-compatible webpack-fix-style-only-entries) to remove empty JS bundles for style-only entrypoints.
  plugins.manifest() : Create and return a new webpack-manifest-plugin instance, preconfigured to write the manifest file while running from a dev server.
P plugins.miniCssExtract() Create and return a new mini-css-extract-plugin instance.
P plugins.terser() Create and return a new terser-webpack-plugin instance, preconfigured with defaults based on create-react-app.
P plugins.cssMinimizer() Create and return a new css-minimizer-webpack-plugin instance.

P: Included in presets.production()