A command-line interface for webpack, designed to make configuration, execution, and management of webpack projects easier and more efficient.
- Easy configuration: Quickly set up and modify your webpack projects.
- Project execution: Run build, serve, and watch commands from the CLI.
- Management tools: List, add, or remove loaders and plugins.
- Duplicate code detection: Find and fix duplicate code in your project.
- Security: Best practices to help keep your codebase secure.
- Error handling: Clear reporting and guidance to resolve configuration and runtime errors.
npm install -g webpack-cli
Or as a dev dependency:
npm install --save-dev webpack-cli
Basic usage:
webpack-cli [command] [options]
Command | Description |
---|---|
init |
Initialize a new webpack project |
build |
Build your project |
serve |
Start a development server |
config |
View or edit webpack configuration |
analyze |
Analyze bundle for duplicate code |
fix |
Attempt to fix detected issues |
Example:
webpack-cli build --mode production
- Avoid committing sensitive information in config files.
- Use latest versions of loaders and plugins.
- Run
webpack-cli analyze
to scan for potential duplicate or vulnerable code.
- If you encounter errors, use
webpack-cli fix
to automatically resolve common issues. - For detailed logs, run commands with the
--verbose
flag.
Contributions are welcome! Please open an issue or submit a pull request. Before contributing, review the Code of Conduct and Contributing Guidelines if available.
This project is licensed under the MIT License.
For more details and advanced usage, see the webpack documentation.