Registry / devops / webpack-nano

webpack-nano

JSON →
library1.1.1jsnpmunverified

A minimal, lightweight CLI for webpack that focuses on configuration file use, allowing unlimited custom command-line flags via the webpack-nano/argv export. Current stable version is 1.1.1. It is maintained as a smaller alternative to webpack-cli, roughly 90% smaller. Supports config files in Babel, ES6, TypeScript, and ESM formats with appropriate loaders. Drops Node <10 support since v0.7.0 and includes breaking changes in v1.0.0 due to yargs-parser update affecting parsed argv output.

npm install webpack-nano
INSTALL
IMPORT
SIG · WEBPACK-NANO
W
webpack-nano
devopsjavascriptv1.1.1
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default (CLI binary wp)
npx wp
npx webpack
The binary is `wp`, not `webpack`. Install locally and run via npx.
argv
import { argv } from 'webpack-nano/argv'
const argv = require('webpack-nano').argv
Export is at path 'webpack-nano/argv', not in main export. Since v1.0.0, parsed results may differ due to yargs-parser update.
require('webpack-nano/argv')
const argv = require('webpack-nano/argv')
const { argv } = require('webpack-nano')
CommonJS require from subpath. Destructuring from main export is incorrect.

Install webpack-nano with webpack, create a basic config, and run a build using the wp CLI.

npm install webpack-nano webpack --save-dev # Create webpack.config.js module.exports = { entry: './src/index.js', output: { filename: 'bundle.js', path: __dirname + '/dist' } }; # Build npx wp --config webpack.config.js
wp --version
Debug
Known issues
breakingv1.0.0: yargs-parser update changes parsed argv results
fix
Review usage of 'webpack-nano/argv' output; ensure custom flags parse as expected under the new parser.
affects: >=1.0.0
breakingv0.7.0: drops Node v8 support
fix
Use Node v10 or higher.
affects: >=0.7.0
deprecatedv0.5.0: stats colors enabled by default, excluding node_modules in stats output
fix
If relying on previous behavior, explicitly set `stats.colors: false` and `stats.exclude: undefined` in webpack config.
affects: >=0.5.0 <0.6.0
gotchaThe binary name is 'wp', not 'webpack'.
fix
Use `npx wp` instead of `npx webpack`.
affects: >=0.0.0
gotchaImport 'webpack-nano/argv' is not the main export; must use exact subpath.
fix
Use `import { argv } from 'webpack-nano/argv'` or `const argv = require('webpack-nano/argv')`.
affects: >=0.0.0
Errors
Common errors & fixes
Error: Cannot find module 'webpack'
webpack is a peer dependency but not installed.
fix
Run `npm install webpack --save-dev` alongside webpack-nano.
Error: Cannot find module 'webpack-nano/argv'
Using import from wrong path or older version without subpath export.
fix
Ensure you are using `require('webpack-nano/argv')` or `import { argv } from 'webpack-nano/argv'`. Requires webpack-nano >=0.5.0.
TypeError: Cannot destructure property 'argv' of 'undefined' or 'null'
Attempting to destructure argv from the main package export.
fix
Use the correct subpath: `const argv = require('webpack-nano/argv')`
Upgrade
Version history
1.1.1latest on npm
Audit
Dependencies
webpackrequiredpeer dependency required to run builds
Agent activity
17 hits · last 30 days
node
14
OpenAI (training)
1
Resources
webpack-nano — npm install webpack-nano · libregistry