p-webpack is a thin wrapper that adds Promise support to Webpack's compile API (versions 1-4). Version 1.0.1 is the current stable release. It accepts the same configuration options as Webpack and returns a Promise that resolves with the compilation stats. It is a minimal, no-dependency library that simply promisifies the callback-based compiler.run(). Unlike alternatives like webpack-promise or manual wrapping, p-webpack focuses only on the run method and maintains full compatibility with Webpack's options object. It is suitable for Node.js 4+ and requires Webpack as a peer dependency.
npm install p-webpackVerified import paths — ran on the pinned version, not inferred.
Shows basic usage of p-webpack with async/await, using a simple webpack configuration.
Run 'npm install webpack' alongside p-webpack.
Use webpack's native promise support or upgrade to a newer wrapper.
Use webpack's own multi-compiler or watch APIs directly for those features.
Change 'const { webpack } = require("p-webpack")' to 'const webpack = require("p-webpack")'.Run 'npm install webpack' in your project.