class JsCompiler extends RevisionCompiler
Traits
Constants
| EMPTY_REVISION |
|
Properties
| protected callable[] | $sourcesCallbacks | from HasSources |
|
|
| protected array<string,string> | $pendingSidecars | Sidecar files (e.g. JsCompiler's `.map`) queued by renderOutput() during the current commit, written only if the primary file is — so an unchanged bundle rewrites nothing at all. | from RevisionCompiler |
|
Methods
No description
Recompile this asset and record its revision. Files are only written when the compiled output actually differs from what the revision manifest says is on disk (or the file has gone missing) — so routine rebuilds of unchanged assets are complete no-ops with zero writes.
Assemble the JS bundle and its sourcemap. The `.map` sidecar is written here as a side effect; the returned string is the JS file's content, which the parent commits and hashes for the revision. Hashing this — rather than the raw concatenated source — means the revision reflects the sourcemap comment and `format()` rewrite that the written file actually carries.
Details
in HasSources
at
line 25
void
addSources(callable $callback)
in HasSources
at
line 33
protected array
getSources()
in HasSources
at
line 44
abstract protected array
allowedSourceTypes()
in RevisionCompiler
at
line 28
__construct(Cloud $assetsDir, string $filename, SettingsRepositoryInterface $settings, VersionerInterface $versioner)
in RevisionCompiler
at
line 36
string|null
getFilename()
in RevisionCompiler
at
line 41
void
setFilename(string $filename)
in RevisionCompiler
at
line 57
void
commit(bool $force = false)
Recompile this asset and record its revision. Files are only written when the compiled output actually differs from what the revision manifest says is on disk (or the file has gone missing) — so routine rebuilds of unchanged assets are complete no-ops with zero writes.
in RevisionCompiler
at
line 101
protected void
writePendingSidecars()
in RevisionCompiler
at
line 108
protected string
hashOutput(string $content)
at
line 30
protected string|null
renderOutput(array $sources)
Assemble the JS bundle and its sourcemap. The `.map` sidecar is written here as a side effect; the returned string is the JS file's content, which the parent commits and hashes for the revision. Hashing this — rather than the raw concatenated source — means the revision reflects the sourcemap comment and `format()` rewrite that the written file actually carries.