mirror of
https://github.com/flarum/core.git
synced 2025-07-21 08:41:17 +02:00
Allow easier overriding of js compiler (#2318)
This commit is contained in:
@@ -102,7 +102,7 @@ class Assets
|
|||||||
|
|
||||||
public function makeJs(): JsCompiler
|
public function makeJs(): JsCompiler
|
||||||
{
|
{
|
||||||
$compiler = new JsCompiler($this->assetsDir, $this->name.'.js');
|
$compiler = $this->makeJsCompiler($this->name.'.js');
|
||||||
|
|
||||||
$this->populate($compiler, 'js');
|
$this->populate($compiler, 'js');
|
||||||
|
|
||||||
@@ -120,7 +120,7 @@ class Assets
|
|||||||
|
|
||||||
public function makeLocaleJs(string $locale): JsCompiler
|
public function makeLocaleJs(string $locale): JsCompiler
|
||||||
{
|
{
|
||||||
$compiler = new JsCompiler($this->assetsDir, $this->name.'-'.$locale.'.js');
|
$compiler = $this->makeJsCompiler($this->name.'-'.$locale.'.js');
|
||||||
|
|
||||||
$this->populate($compiler, 'localeJs', $locale);
|
$this->populate($compiler, 'localeJs', $locale);
|
||||||
|
|
||||||
@@ -136,6 +136,11 @@ class Assets
|
|||||||
return $compiler;
|
return $compiler;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function makeJsCompiler(string $filename)
|
||||||
|
{
|
||||||
|
return new JsCompiler($this->assetsDir, $filename);
|
||||||
|
}
|
||||||
|
|
||||||
protected function makeLessCompiler(string $filename): LessCompiler
|
protected function makeLessCompiler(string $filename): LessCompiler
|
||||||
{
|
{
|
||||||
$compiler = new LessCompiler($this->assetsDir, $filename);
|
$compiler = new LessCompiler($this->assetsDir, $filename);
|
||||||
|
Reference in New Issue
Block a user