1
0
mirror of https://github.com/flarum/core.git synced 2025-10-12 07:24:27 +02:00
Files
php-flarum/src/Frontend/Asset/JsCompiler.php
Toby Zerner 3f683dd6ee Webpack (#1367)
* Replace gulp with webpack and npm scripts for JS compilation
* Set up Travis CI to commit compiled JS
* Restructure `js` directory; only one instance of npm, forum/admin are "submodules"
* Refactor JS initializers into Application subclasses
* Maintain partial compatibility API (importing from absolute paths) for extensions
* Remove minification responsibility from PHP asset compiler
* Restructure `less` directory
2018-06-20 13:20:31 +09:30

52 lines
968 B
PHP

<?php
/*
* This file is part of Flarum.
*
* (c) Toby Zerner <toby.zerner@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Flarum\Frontend\Asset;
use Illuminate\Cache\Repository;
class JsCompiler extends RevisionCompiler
{
/**
* @var Repository
*/
protected $cache;
/**
* @param string $path
* @param string $filename
* @param bool $watch
* @param Repository $cache
*/
public function __construct($path, $filename, $watch = false, Repository $cache = null)
{
parent::__construct($path, $filename, $watch);
$this->cache = $cache;
}
/**
* {@inheritdoc}
*/
protected function format($string)
{
return $string.";\n";
}
/**
* {@inheritdoc}
*/
protected function getCacheDifferentiator()
{
return $this->watch;
}
}