webpack-stream
raw JSON → 7.0.0 verified Sat Apr 25 auth: no javascript
Run webpack as a stream to conveniently integrate with gulp. Version 7.0.0 requires webpack ^5.21.2 as a peer dependency and Node >= 10.0.0. Releases follow semver with active development. Key differentiators: simplifies piping webpack builds through gulp streams, supports watch mode with caching, and allows passing webpack config directly or via external config file.
Common errors
error Error: Cannot find module 'webpack' ↓
cause webpack is not installed as a peer dependency.
fix
Run npm install --save-dev webpack
error TypeError: webpack is not a function ↓
cause Importing incorrectly (e.g., named import) or using wrong version.
fix
Use: const webpack = require('webpack-stream') or import webpack from 'webpack-stream'
error Error: webpack-stream v7 requires webpack ^5.21.2 ↓
cause Incompatible webpack version.
fix
Upgrade webpack to ^5.21.2
Warnings
breaking v7.0.0 dropped support for webpack < 5 and Node < 10. ↓
fix Upgrade to webpack ^5.21.2 and Node >= 10.
gotcha Do not mix gulp.watch with webpack's watch option; they are mutually exclusive. ↓
fix Use gulp.watch or webpack's watch, not both.
gotcha When using gulp.watch, you must pass webpack as second argument to create a cached compiler instance. ↓
fix Use gulpWebpack({}, webpack, callback) with the imported webpack module.
deprecated In v6 and earlier, webpack4 was default; v7 requires webpack5. ↓
fix Update webpack to ^5.21.2 and use v7.
Install
npm install webpack-stream yarn add webpack-stream pnpm add webpack-stream Imports
- default export wrong
const webpack = require('webpack-stream')correctimport webpack from 'webpack-stream' - require
const webpack = require('webpack-stream') - named export (none) Internal server error