Allows to skip building assets
This commit is contained in:
parent
0f6d7168b4
commit
9aca3bc890
|
@ -17,7 +17,7 @@ class Render extends Command
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
protected $signature = 'bundle:render { --i|ignore-cache : Ignore cache }';
|
protected $signature = 'bundle:render { --a|assets : Rebuild assets }';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The console command description.
|
* The console command description.
|
||||||
|
@ -31,17 +31,21 @@ class Render extends Command
|
||||||
*/
|
*/
|
||||||
public function handle()
|
public function handle()
|
||||||
{
|
{
|
||||||
|
if ($this->options('assets')) {
|
||||||
$this->output->write('Building assets... ');
|
$this->output->write('Building assets... ');
|
||||||
Process::run('npm run build')->throw();
|
Process::run('npm run build')->throw();
|
||||||
$this->info('OK');
|
$this->info('OK');
|
||||||
|
|
||||||
|
$this->call('cache:clear');
|
||||||
|
}
|
||||||
|
|
||||||
$path = '/';
|
$path = '/';
|
||||||
$bundles = Bundle::findBundles(Storage::disk(env('CONTENT_DISK')), $path, true);
|
$bundles = Bundle::findBundles(Storage::disk(env('CONTENT_DISK')), $path, true);
|
||||||
$progress = progress(label: 'Rendering... ', steps: count($bundles));
|
$progress = progress(label: 'Rendering... ', steps: count($bundles));
|
||||||
$progress->start();
|
$progress->start();
|
||||||
|
|
||||||
foreach ($bundles as $bundle) {
|
foreach ($bundles as $bundle) {
|
||||||
$result = $bundle->render($this->option('ignore-cache'));
|
$result = $bundle->render();
|
||||||
|
|
||||||
foreach ($result as $path => $content) {
|
foreach ($result as $path => $content) {
|
||||||
if (!Str::contains($path, '.')) {
|
if (!Str::contains($path, '.')) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user