mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-23 20:00:33 -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
|
git checkout main
|
||||||
npm i
|
npm i
|
||||||
npm run build
|
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/
|
mkdir -p ../public/tinymce_6.4.2/tinymce/js/
|
||||||
cp -r node_modules/tinymce ../public/tinymce_6.4.2/tinymce/js/
|
cp -r node_modules/tinymce ../public/tinymce_6.4.2/tinymce/js/
|
||||||
cd ..
|
cd ..
|
||||||
|
@ -12,7 +12,6 @@
|
|||||||
namespace App\Console\Commands;
|
namespace App\Console\Commands;
|
||||||
|
|
||||||
use Illuminate\Console\Command;
|
use Illuminate\Console\Command;
|
||||||
use Illuminate\Support\Facades\Storage;
|
|
||||||
|
|
||||||
class ReactBuilder extends Command
|
class ReactBuilder extends Command
|
||||||
{
|
{
|
||||||
@ -49,12 +48,10 @@ class ReactBuilder extends Command
|
|||||||
{
|
{
|
||||||
$includes = '';
|
$includes = '';
|
||||||
|
|
||||||
Storage::makeDirectory(public_path('react'));
|
|
||||||
|
|
||||||
$directoryIterator = new \RecursiveDirectoryIterator(public_path('react'), \RecursiveDirectoryIterator::SKIP_DOTS);
|
$directoryIterator = new \RecursiveDirectoryIterator(public_path('react'), \RecursiveDirectoryIterator::SKIP_DOTS);
|
||||||
|
|
||||||
foreach (new \RecursiveIteratorIterator($directoryIterator) as $file) {
|
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-')) {
|
if (str_contains($file->getFileName(), 'index-')) {
|
||||||
$includes .= '<script type="module" crossorigin src="/react/'.$file->getFileName().'"></script>'."\n";
|
$includes .= '<script type="module" crossorigin src="/react/'.$file->getFileName().'"></script>'."\n";
|
||||||
} else {
|
} 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";
|
$includes .= '<link rel="stylesheet" href="/react/'.$file->getFileName().'">'."\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user