qiao-webpack

raw JSON →
5.0.5 verified Sat May 09 auth: no javascript

qiao-webpack is a webpack utility library for simplifying webpack configuration in Node.js projects. The current stable version is 5.0.5, released in 2023 with irregular updates. It wraps common webpack functionality into concise APIs, reducing boilerplate. Unlike raw webpack usage, qiao-webpack provides pre-configured loaders and plugins for rapid setup, though it may lack customization. Suitable for quick prototyping with webpack but not recommended for complex builds. Requires webpack and related loaders as peer dependencies.

error Error: Cannot find module 'qiao-webpack'
cause Package not installed or not in node_modules.
fix
Run 'npm install qiao-webpack --save'.
error TypeError: webpack is not a function
cause Incorrect import method (e.g., using named import instead of default).
fix
Use 'const webpack = require("qiao-webpack")' (no destructuring).
error Error: Unknown option '--config'
cause Using CLI syntax that is not supported by this package's wrapper.
fix
Use the API directly: webpack(config).then(...).
gotcha Package uses CommonJS only; not designed for ESM or TypeScript projects.
fix Use require() instead of import statements.
deprecated Version 5.x may rely on webpack 4 internally; check compatibility with webpack 5.
fix Upgrade to latest version or specify webpack version in peer dependencies.
gotcha No TypeScript definitions provided; type checking may fail in TS projects.
fix Create custom .d.ts file or use // @ts-ignore.
npm install qiao-webpack
yarn add qiao-webpack
pnpm add qiao-webpack

Shows basic usage of qiao-webpack to compile an entry point with default settings.

const webpack = require('qiao-webpack');

// Minimal webpack configuration
const config = {
  entry: './src/index.js',
  output: {
    path: __dirname + '/dist',
    filename: 'bundle.js'
  }
};

// Run webpack with config
webpack(config).then(stats => {
  console.log('Build completed:', stats);
}).catch(err => {
  console.error('Build failed:', err);
});