mirror of
https://github.com/flarum/framework.git
synced 2024-12-02 06:53:47 +08:00
Allow easier overriding of js compiler (#2318)
This commit is contained in:
parent
7629aad6ce
commit
656dec65dc
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user