parcel-config-cli
raw JSON → 1.0.0 verified Sat May 09 auth: no javascript
CLI tool for generating and managing Parcel bundler configurations version 1.0.0. Parcel-config-cli provides a command-line interface to initialize, validate, view, modify, and compare Parcel configuration files. It includes template-based scaffolding (minimal, standard, advanced), built-in validation to catch errors before deployment, environment-aware management for dev/staging/production, and diff support. Unlike manual config editing, it offers zero runtime dependencies (only commander and chalk), making it lightweight and easy to integrate into CI/CD pipelines. The project is currently stable and actively maintained on GitHub.
Common errors
error Error: Cannot find module 'parcel-config-cli' ↓
cause The package is not installed or not found in node_modules.
fix
Install globally: npm install -g parcel-config-cli, or use npx: npx parcel-config-cli init
error parcel-config: command not found ↓
cause Global installation is missing or PATH is not set correctly.
fix
Install globally: npm install -g parcel-config-cli, or run via npx: npx parcel-config init
error Unrecognized option: --format ↓
cause The --format flag has been replaced by --json.
fix
Use --json instead: parcel-config show --json
Warnings
gotcha The generated config files use the .parcelrc naming convention; if you rename them, the CLI commands may not detect them automatically. ↓
fix Ensure the config file is named .parcelrc or explicitly pass the path to commands: parcel-config validate path/to/config.json
breaking Version 1.0.0 changed the default template from 'minimal' to 'standard'. Existing projects upgrading may need to adjust their config. ↓
fix Run parcel-config init --template minimal to revert to the old default if needed.
deprecated The --format flag in the show command is deprecated; use --json instead. ↓
fix Replace --format json with --json in your scripts.
gotcha The set command only supports string values; boolean and number values must be provided as strings (e.g., 'true' or '123'). ↓
fix Wrap values in quotes when using the CLI: parcel-config set settings.debug 'true'
Install
npm install parcel-config-cli yarn add parcel-config-cli pnpm add parcel-config-cli Imports
- parcel-config wrong
parcel-config initcorrectnpx parcel-config init - init wrong
const init = require('parcel-config-cli')correctimport { init } from 'parcel-config-cli' - validate
import { validate } from 'parcel-config-cli'
Quickstart
// Install globally or use npx
// Initialize a standard Parcel configuration
parcel-config init --template standard
// Validate the generated config
parcel-config validate
// Set a property
parcel-config set settings.debug true
// View config as JSON for production
parcel-config show --env production --json
// Or programmatically:
import { init, validate } from 'parcel-config-cli';
import { writeFileSync } from 'fs';
const config = await init({ template: 'minimal', output: undefined });
const isValid = await validate({ config });
writeFileSync('.parcelrc', JSON.stringify(config, null, 2));
console.log('Config valid:', isValid);