mirror of
https://github.com/flarum/core.git
synced 2025-10-19 18:56:44 +02:00
Bundle unminified JS; minify via ClosureCompilerService when in production
Falls back to a less effective minification library if ClosureCompilerService errors or is unavailable. Minification takes a while (20 seconds or so), but it only happens when assets are modified. Still, this means enabling/disabling extensions is taking far too long. Possible solutions: - Don't minify initially; set a process running in the background to do minification, and server unminified assets in the meantime. - Refactor compiler to send each JS file to CCS individually, only if that particular file has been modified. flarum/gulp has also been updated to no longer support uglification. closes #582
This commit is contained in:
@@ -110,6 +110,16 @@ class Application extends Container implements ApplicationContract
|
||||
return $this->bound('flarum.config');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $key
|
||||
* @param mixed $default
|
||||
* @return mixed
|
||||
*/
|
||||
public function config($key, $default = null)
|
||||
{
|
||||
return array_get($this->make('flarum.config'), $key, $default);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if Flarum is in debug mode.
|
||||
*
|
||||
@@ -117,7 +127,7 @@ class Application extends Container implements ApplicationContract
|
||||
*/
|
||||
public function inDebugMode()
|
||||
{
|
||||
return ! $this->isInstalled() || $this->make('flarum.config')['debug'];
|
||||
return ! $this->isInstalled() || $this->config('debug');
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user