Property | Type | Description | |
---|---|---|---|
$commands | 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. You may also use a path alias to specify the location of the command: php [ 'styl' => ['css', '@app/node_modules/bin/stylus < {from} > {to}'], ] | ||
$forceConvert | whether the source asset file should be converted even if its result already exists. You may want to set this to be true during the development stage to make sure the converted assets are always up-to-date. Do not set this to true on production servers as it will significantly degrade the performance. |
Method | Description | |
---|---|---|
convert ( string $asset, string $basePath ) : string | Converts a given asset file into a CSS or JS file. |
Method | Description | |
---|---|---|
runCommand ( string $command, string $basePath, string $asset, string $result ) : boolean | Runs a command to convert asset files. |
protected runCommand ( string $command, string $basePath, string $asset, string $result ) : boolean | ||
$command | string | the command to run. If prefixed with an `@` it will be treated as a path alias. |
$basePath | string | asset base path and command working directory |
$asset | string | the name of the asset file |
$result | string | the name of the file to be generated by the converter command |
return | boolean | true on success, false on failure. Failures will be logged. |
public $commands |
public $forceConvert |