$assetMap public property
Mapping from source asset files (keys) to target asset files (values).
This property is provided to support fixing incorrect asset file paths in some asset bundles. When an asset bundle is registered with a view, each relative asset file in its css and js arrays will be examined against this map. If any of the keys is found to be the last part of an asset file (which is prefixed with yii\web\AssetBundle::$sourcePath if available), the corresponding value will replace the asset and be registered with the view. For example, an asset file my/path/to/jquery.js
matches a key jquery.js
.
Note that the target asset files should be absolute URLs, domain relative URLs (starting from '/') or paths relative to $baseUrl and $basePath.
In the following example, any assets ending with jquery.min.js
will be replaced with jquery/dist/jquery.js
which is relative to $baseUrl and $basePath.
[ 'jquery.min.js' => 'jquery/dist/jquery.js', ]
You may also use aliases while specifying map value, for example:
[ 'jquery.min.js' => '@web/js/jquery/jquery.js', ]
Please login to continue.