class JsDirectoryCompiler implements CompilerInterface

Used to copy JS files from a package directory to the assets' directory.

Without concatenating them. Primarily used for lazy loading JS modules.

Traits

Properties

protected callable[] $sourcesCallbacks from HasSources
protected $versioner

Methods

void
addSources(callable $callback)

No description

DirectorySource[]
getSources()

No description

array
allowedSourceTypes()

No description

__construct(Cloud $assetsDir, string $destinationPath)

No description

string|null
getFilename()

No description

void
setFilename(string $filename)

No description

void
commit(bool $force = false)

No description

string|null
getUrl()

No description

void
flush()

No description

void
compileSource(DirectorySource $source, bool $force = false)

No description

void
flushSource(DirectorySource $source)

No description

void
eachFile(DirectorySource $source, callable $callback)

No description

compilerFor(DirectorySource $source, FilesystemAdapter $filesystem, string $relativeFilePath)

No description

string
destinationFor(DirectorySource $source, string|null $relativeFilePath = null)

No description

Details

void addSources(callable $callback)

Parameters

callable $callback

Return Value

void

DirectorySource[] getSources()

Return Value

DirectorySource[]

protected array allowedSourceTypes()

Return Value

array

__construct(Cloud $assetsDir, string $destinationPath)

Parameters

Cloud $assetsDir
string $destinationPath

string|null getFilename()

Return Value

string|null

void setFilename(string $filename)

Parameters

string $filename

Return Value

void

void commit(bool $force = false)

Parameters

bool $force

Return Value

void

string|null getUrl()

Return Value

string|null

void flush()

Return Value

void

protected void compileSource(DirectorySource $source, bool $force = false)

Parameters

DirectorySource $source
bool $force

Return Value

void

protected void flushSource(DirectorySource $source)

Parameters

DirectorySource $source

Return Value

void

protected void eachFile(DirectorySource $source, callable $callback)

Parameters

DirectorySource $source
callable $callback

Return Value

void

protected JsCompiler compilerFor(DirectorySource $source, FilesystemAdapter $filesystem, string $relativeFilePath)

Parameters

DirectorySource $source
FilesystemAdapter $filesystem
string $relativeFilePath

Return Value

JsCompiler

protected string destinationFor(DirectorySource $source, string|null $relativeFilePath = null)

Parameters

DirectorySource $source
string|null $relativeFilePath

Return Value

string