clean-css-cli
Advanced tools
Comparing version 5.4.2 to 5.5.0
@@ -0,1 +1,6 @@ | ||
[5.5.0 / 2021-12-08](https://github.com/clean-css/clean-css-cli/compare/5.4...v5.5.0) | ||
================== | ||
* Adds a new `--watch` switch, which makes CLI re-run optimizations when watched file(s) change. | ||
[5.4.2 / 2021-10-21](https://github.com/clean-css/clean-css-cli/compare/v5.4.1...v5.4.2) | ||
@@ -2,0 +7,0 @@ ================== |
16
index.js
@@ -40,3 +40,4 @@ var fs = require('fs'); | ||
.option('--source-map-inline-sources', 'Enables inlining sources inside source maps') | ||
.option('--with-rebase', 'Enable URLs rebasing'); | ||
.option('--with-rebase', 'Enable URLs rebasing') | ||
.option('--watch', 'Runs CLI in watch mode'); | ||
@@ -148,3 +149,14 @@ program.on('--help', function () { | ||
if (program.args.length > 0) { | ||
minify(process, options, configurations, expandGlobs(program.args)); | ||
var expandedGlobs = expandGlobs(program.args); | ||
if (inputOptions.watch) { | ||
var inputPaths = expandedGlobs.map(function (path) { return path.expanded; }); | ||
minify(process, options, configurations, expandedGlobs); | ||
require('chokidar').watch(inputPaths).on('change', function (pathToChangedFile) { | ||
console.log(`File '${pathToChangedFile}' has changed. Rerunning all optimizations...`); | ||
minify(process, options, configurations, expandedGlobs); | ||
}); | ||
} else { | ||
minify(process, options, configurations, expandedGlobs); | ||
} | ||
} else { | ||
@@ -151,0 +163,0 @@ stdin = process.openStdin(); |
{ | ||
"name": "clean-css-cli", | ||
"version": "5.4.2", | ||
"version": "5.5.0", | ||
"description": "A command-line interface to clean-css CSS optimization library", | ||
@@ -37,2 +37,3 @@ "scripts": { | ||
"dependencies": { | ||
"chokidar": "^3.5.2", | ||
"clean-css": "^5.2.2", | ||
@@ -39,0 +40,0 @@ "commander": "7.x", |
@@ -22,2 +22,3 @@ <h1 align="center"> | ||
- [Use](#use) | ||
* [What's new in version 5.5](#whats-new-in-version-55) | ||
* [What's new in version 5.1](#whats-new-in-version-51) | ||
@@ -65,2 +66,8 @@ * [What's new in version 5.0](#whats-new-in-version-50) | ||
## What's new in version 5.5 | ||
clean-css-cli 5.5 introduces the following changes / features: | ||
* adds a new `--watch` switch, which makes `cleancss` re-run optimizations when watched file(s) change. | ||
## What's new in version 5.1 | ||
@@ -67,0 +74,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
44673
315
481
4
+ Addedchokidar@^3.5.2
+ Addedanymatch@3.1.3(transitive)
+ Addedbinary-extensions@2.3.0(transitive)
+ Addedbraces@3.0.3(transitive)
+ Addedchokidar@3.6.0(transitive)
+ Addedfill-range@7.1.1(transitive)
+ Addedfsevents@2.3.3(transitive)
+ Addedglob-parent@5.1.2(transitive)
+ Addedis-binary-path@2.1.0(transitive)
+ Addedis-extglob@2.1.1(transitive)
+ Addedis-glob@4.0.3(transitive)
+ Addedis-number@7.0.0(transitive)
+ Addednormalize-path@3.0.0(transitive)
+ Addedpicomatch@2.3.1(transitive)
+ Addedreaddirp@3.6.0(transitive)
+ Addedto-regex-range@5.0.1(transitive)