class Assets
A factory class for creating frontend asset compilers.
Properties
| array | $sources |
|
||
| protected array | $lessImportOverrides |
|
||
| protected array | $fileSourceOverrides |
|
Methods
No description
Where the webfonts referenced by the compiled CSS live on disk, so their URLs can be revisioned. Font URLs are written relative to the stylesheet that imports them (`../webfonts/…`), so the fonts sit beside each LESS import directory — that is the same directory the assets publisher copies into `assets/fonts`.
The revision the compiled stylesheet puts on a webfont's URL (`?v=…`), or null when the font can't be read. Anything else that links to a bundled font, like the font preloads, must use it: a preload is only used when its URL is exactly the one the stylesheet requests.
Details
at
line 38
__construct(string $name, Cloud $assetsDir, string|null $cacheDir = null, array|null $lessImportDirs = null, array $customFunctions = [])
at
line 96
JsCompiler
makeJs()
at
line 105
LessCompiler
makeCss()
at
line 114
JsCompiler
makeLocaleJs(string $locale)
at
line 123
LessCompiler
makeLocaleCss(string $locale)
at
line 132
JsDirectoryCompiler
makeJsDirectory()
at
line 141
protected JsCompiler
makeJsCompiler(string $filename)
at
line 149
protected LessCompiler
makeLessCompiler(string $filename)
at
line 185
protected string|null
fontsDir()
Where the webfonts referenced by the compiled CSS live on disk, so their URLs can be revisioned. Font URLs are written relative to the stylesheet that imports them (`../webfonts/…`), so the fonts sit beside each LESS import directory — that is the same directory the assets publisher copies into `assets/fonts`.
at
line 208
string|null
fontRevision(string $file)
The revision the compiled stylesheet puts on a webfont's URL (`?v=…`), or null when the font can't be read. Anything else that links to a bundled font, like the font preloads, must use it: a preload is only used when its URL is exactly the one the stylesheet requests.
Cached, since the preloads are built on every page view and the hash only changes with the file. The key includes the file's size and modification time, so a replaced font gets its new revision straight away.