diff --git a/framework/CHANGELOG.md b/framework/CHANGELOG.md index ddcbcc3809..e7b3f4a2c3 100644 --- a/framework/CHANGELOG.md +++ b/framework/CHANGELOG.md @@ -6,6 +6,7 @@ Yii Framework 2 Change Log - Bug #19243: Handle `finfo_open` for tar.xz as `application/octet-stream` on PHP 8.1 (longthanhtran) - Bug #19235: Fix return type compatibility of `yii\web\SessionIterator` class methods for PHP 8.1 (virtual-designer) +- Enh #19270: Replace deprecated `scss` converter in `yii\web\AssetConverter::$commands` (WinterSilence) - Enh #19254: Support specifying custom characters for `yii.validation.trim()` and replace deprecated `jQuery.trim()` (WinterSilence) - Bug #19291: Reset errors and validators in `yii\base\Model::__clone()` (WinterSilence) - Enh #19295: Added alias `text/rtf` for mime-type `application/rtf` (lesha724) diff --git a/framework/web/AssetConverter.php b/framework/web/AssetConverter.php index 0cfc0d86e5..c748018513 100644 --- a/framework/web/AssetConverter.php +++ b/framework/web/AssetConverter.php @@ -12,7 +12,7 @@ use yii\base\Component; use yii\base\Exception; /** - * AssetConverter supports conversion of several popular script formats into JS or CSS scripts. + * AssetConverter supports conversion of several popular formats into JS or CSS files. * * It is used by [[AssetManager]] to convert files after they have been published. * @@ -25,6 +25,8 @@ class AssetConverter extends Component implements AssetConverterInterface * @var array the commands that are used to perform the asset conversion. * The keys are the asset file extension names, and the values are the corresponding * target script types (either "css" or "js") and the commands used for the conversion. + * + * The command placeholders: `{from}` - source file, `{to}` - converted file. * * You may also use a [path alias](guide:concept-aliases) to specify the location of the command: * @@ -33,11 +35,15 @@ class AssetConverter extends Component implements AssetConverterInterface * 'styl' => ['css', '@app/node_modules/bin/stylus < {from} > {to}'], * ] * ``` + * + * Note: `Yii::getAlias()` can replace alias at the begin of the command only. + * + * @see https://sass-lang.com/documentation/cli/ SASS/SCSS */ public $commands = [ 'less' => ['css', 'lessc {from} {to} --no-color --source-map'], - 'scss' => ['css', 'sass {from} {to} --sourcemap'], - 'sass' => ['css', 'sass {from} {to} --sourcemap'], + 'scss' => ['css', 'sass --style=compressed {from} {to}'], + 'sass' => ['css', 'sass --style=compressed {from} {to}'], 'styl' => ['css', 'stylus < {from} > {to}'], 'coffee' => ['js', 'coffee -p {from} > {to}'], 'ts' => ['js', 'tsc --out {to} {from}'],