Skip to content

CLI for bundling and minification of CSS and JavaScript using WebOptimizer

License

Notifications You must be signed in to change notification settings

alan-null/WebOptimizerCLI

Repository files navigation

WebOptimizer CLI

The WebOptimizer CLI is a command-line tool for bundling and minification of CSS and JavaScript using WebOptimizer.

Description

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.

Installation

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.

Usage

The CLI tool provides commands to create CSS and JS bundles. Below are the available commands and their options.

Commands

bundle

The bundle command is used to create CSS and JS bundles.

Subcommands
  • css: Process CSS bundle
  • js: Process JS bundle
Options
  • --output, -o (required): Output file path for the bundle
  • --sources, -s (required): Array of source files for the bundle

Examples

Create a CSS 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

Create a JS Bundle

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

Examples

# bundle and minify CSS files using patterns
.\weboptimizer.exe bundle css -s css/**/*.css -o main.min.css

License

MIT License © Alan Płócieniak

About

CLI for bundling and minification of CSS and JavaScript using WebOptimizer

Topics

Resources

License

Stars

Watchers

Forks

Languages