The WebOptimizer CLI is a command-line tool for bundling and minification of CSS and JavaScript using WebOptimizer.
The WebOptimizer CLI provides a simple interface to create CSS and JS bundles. The bundle
command has two subcommands: css
and js
, each of which requires an output file path and an array of source files.
When you run the css
subcommand, the tool processes the specified CSS source files and creates a bundled output file. Similarly, the js
subcommand processes the specified JS source files and creates a bundled output file.
To install the WebOptimizer CLI, you need to have .NET 9 installed on your machine. You can then build and run the CLI tool from the source code.
The CLI tool provides commands to create CSS and JS bundles. Below are the available commands and their options.
The bundle
command is used to create CSS and JS bundles.
css
: Process CSS bundlejs
: Process JS bundle
--output
,-o
(required): Output file path for the bundle--sources
,-s
(required): Array of source files for the bundle
To create a CSS bundle, use the following command:
dotnet run -- bundle css --output path/to/output.css --sources path/to/source1.css path/to/source2.css
To create a JS bundle, use the following command:
dotnet run -- bundle js --output path/to/output.js --sources path/to/source1.js path/to/source2.js
# bundle and minify CSS files using patterns
.\weboptimizer.exe bundle css -s css/**/*.css -o main.min.css
MIT License © Alan Płócieniak