mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-02-23 06:47:40 +01:00
fix: 🐛 Fix dev server quando si usano moduli custom
This commit is contained in:
parent
451a1b66be
commit
450a849c16
36
app/Console/Commands/DevServerFix.php
Normal file
36
app/Console/Commands/DevServerFix.php
Normal file
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Facades\File;
|
||||
|
||||
class DevServerFix extends Command
|
||||
{
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'osm:dev-server-fix';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Fix modules before starting the dev server';
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*/
|
||||
final public function handle(): int
|
||||
{
|
||||
foreach (glob(resource_path('static/vendor') . '/*/*/index.js', GLOB_NOSORT) as $file) {
|
||||
$content = File::get($file);
|
||||
File::put($file, str_replace('../../../index.js', '/resources/js/index.js', $content));
|
||||
}
|
||||
|
||||
return Command::SUCCESS;
|
||||
}
|
||||
}
|
@ -5,7 +5,7 @@
|
||||
"private": true,
|
||||
"main": "resources/js/index.js",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"dev": "php artisan osm:dev-server-fix && vite",
|
||||
"build": "vite build",
|
||||
"serve": "php artisan serve",
|
||||
"watch": "vite build --watch",
|
||||
|
Loading…
x
Reference in New Issue
Block a user