mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Fixes for react build
This commit is contained in:
parent
8137a7989c
commit
50d6c9ffb9
10
.github/workflows/release.yml
vendored
10
.github/workflows/release.yml
vendored
@ -46,7 +46,15 @@ jobs:
|
||||
git checkout main
|
||||
npm i
|
||||
npm run build
|
||||
cp -r dist/react/* ../public/react
|
||||
|
||||
for file in dist/react/* ; do
|
||||
filename=$(basename -- "$file")
|
||||
extension="${filename##*.}"
|
||||
filename="${filename%.*}"
|
||||
version=${{ github.event.release.tag_name }}
|
||||
cp dist/react/$file ../public/react/$filename"."$version"."$extension
|
||||
done
|
||||
|
||||
mkdir -p ../public/tinymce_6.4.2/tinymce/js/
|
||||
cp -r node_modules/tinymce ../public/tinymce_6.4.2/tinymce/js/
|
||||
cd ..
|
||||
|
@ -12,7 +12,6 @@
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
|
||||
class ReactBuilder extends Command
|
||||
{
|
||||
@ -48,13 +47,11 @@ class ReactBuilder extends Command
|
||||
public function handle()
|
||||
{
|
||||
$includes = '';
|
||||
|
||||
Storage::makeDirectory(public_path('react'));
|
||||
|
||||
$directoryIterator = new \RecursiveDirectoryIterator(public_path('react'), \RecursiveDirectoryIterator::SKIP_DOTS);
|
||||
|
||||
foreach (new \RecursiveIteratorIterator($directoryIterator) as $file) {
|
||||
if ($file->getExtension() == 'js') {
|
||||
if ($file->getExtension() == 'js' && stripos($file->getFileName(), config('ninja.app_version')) !== false) {
|
||||
if (str_contains($file->getFileName(), 'index-')) {
|
||||
$includes .= '<script type="module" crossorigin src="/react/'.$file->getFileName().'"></script>'."\n";
|
||||
} else {
|
||||
@ -62,7 +59,7 @@ class ReactBuilder extends Command
|
||||
}
|
||||
}
|
||||
|
||||
if (str_contains($file->getFileName(), '.css')) {
|
||||
if (str_contains($file->getFileName(), '.css' && stripos($file->getFileName(), config('ninja.app_version')) !== false)) {
|
||||
$includes .= '<link rel="stylesheet" href="/react/'.$file->getFileName().'">'."\n";
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user