Skip to content

Commit

Permalink
Allow easier overriding of js compiler
Browse files Browse the repository at this point in the history
  • Loading branch information
luceos committed Sep 27, 2020
1 parent 65766a8 commit 059c842
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/Frontend/Assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ private function populate(CompilerInterface $compiler, string $type, string $loc

public function makeJs(): JsCompiler
{
$compiler = new JsCompiler($this->assetsDir, $this->name.'.js');
$compiler = $this->makeJsCompiler($this->name.'.js');

$this->populate($compiler, 'js');

Expand All @@ -120,7 +120,7 @@ public function makeCss(): LessCompiler

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);

Expand All @@ -136,6 +136,11 @@ public function makeLocaleCss(string $locale): LessCompiler
return $compiler;
}

protected function makeJsCompiler(string $filename)
{
return new JsCompiler($this->assetsDir, $filename);
}

protected function makeLessCompiler(string $filename): LessCompiler
{
$compiler = new LessCompiler($this->assetsDir, $filename);
Expand Down

0 comments on commit 059c842

Please sign in to comment.