Grunt plugin to run webpack 5 builds and webpack-dev-server as Grunt tasks. Current stable version is 7.0.1 (Nov 2025). Release cadence is irregular with major versions aligned to webpack major releases. Requires Node.js >=18.19.0 and webpack ^5 as peer dependencies. Unlike bare webpack CLI, it integrates into Grunt's task pipeline with support for watch mode, progress output, error handling options, and storing stats for other Grunt tasks. Notable breaking changes: v7 dropped Node 16 and removed special cache handling; v6 dropped webpack 4 and Node 12/14; v5 dropped Node <12.13.
npm install grunt-webpackVerified import paths — ran on the pinned version, not inferred.
Shows how to configure grunt-webpack with two targets (prod and dev) and register the plugin. Assumes a separate webpack.config.js.
Upgrade to Node.js 18.19.0 or higher.
Upgrade to webpack 5.
Use webpack's native cache configuration directly.
If you relied on lodash being available, install it separately.
Upgrade to Node.js 16.13.0+ (now 18+ for v7).
Set keepalive: true in watch mode, or use default (true when watch: true).
Add grunt.loadNpmTasks('grunt-webpack'); after grunt.initConfig.Run npm install webpack --save-dev (it's a peer dependency).
Ensure grunt.initConfig({ webpack: { myConfig: ... } }) has the target.