Skip to content

Commit 9eb8974

Browse files
committed
\hexydec\jslite\jslite is now the default Javascript minifier.
Updated composer.
1 parent 097b149 commit 9eb8974

File tree

3 files changed

+72
-10
lines changed

3 files changed

+72
-10
lines changed

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
],
1313
"minimum-stability": "beta",
1414
"require": {
15-
"hexydec/cssdoc": "@dev"
15+
"hexydec/cssdoc": "@dev",
16+
"hexydec/jslite": "@dev"
1617
},
1718
"autoload": {
1819
"classmap": ["src/"]

composer.lock

Lines changed: 53 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/htmldoc/htmldoc.php

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,9 @@ class htmldoc {
180180
*/
181181
public function __construct(array $config = []) {
182182
$this->config = array_replace_recursive($this->config, [
183-
'custom' => [ /// default to CSSdoc if available
183+
'custom' => [
184+
185+
// default to CSSdoc if available
184186
'style' => [
185187
'config' => [
186188
'minifier' => class_exists('\\hexydec\\css\\cssdoc') ? function (string $css, array $minify) {
@@ -192,6 +194,20 @@ public function __construct(array $config = []) {
192194
return $css;
193195
} : null
194196
]
197+
],
198+
199+
// default to JSLite if available
200+
'script' => [
201+
'config' => [
202+
'minifier' => class_exists('\\hexydec\\jslite\\jslite') ? function (string $css, array $minify) {
203+
$obj = new \hexydec\jslite\jslite();
204+
if ($obj->load($css)) {
205+
$obj->minify($minify);
206+
return $obj->compile();
207+
}
208+
return $css;
209+
} : null
210+
]
195211
]
196212
]
197213
], $config);

0 commit comments

Comments
 (0)