pridany build skript,
uprava produkcnej konfiguracie
This commit is contained in:
@ -4,7 +4,7 @@ require __DIR__ . '/../vendor/autoload.php';
|
|||||||
|
|
||||||
ob_start();
|
ob_start();
|
||||||
|
|
||||||
$backend_api = new TPsoft\BugreportBackend\API('typescript', 'import.meta.env.VITE_BACKENDAPI_URL');
|
$backend_api = new TPsoft\BugreportBackend\API('typescript', 'import.meta.env.VITE_BACKENDAPI_URL', 'backend');
|
||||||
|
|
||||||
$output = ob_get_contents();
|
$output = ob_get_contents();
|
||||||
ob_end_clean();
|
ob_end_clean();
|
||||||
|
|||||||
46
build.bat
Normal file
46
build.bat
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
@echo off
|
||||||
|
chcp 65001
|
||||||
|
setlocal enabledelayedexpansion
|
||||||
|
|
||||||
|
echo ➡️ Delete old DIST folder
|
||||||
|
rmdir /s /q "dist"
|
||||||
|
echo ✅ Old DIST deleted
|
||||||
|
|
||||||
|
echo ➡️ Build Backend
|
||||||
|
cd backend
|
||||||
|
call composer run build
|
||||||
|
cd ..
|
||||||
|
echo ✅ Backend built
|
||||||
|
|
||||||
|
echo ➡️ Build frontend
|
||||||
|
cd frontend
|
||||||
|
call npm run build
|
||||||
|
cd ..
|
||||||
|
echo ✅ Frontend built
|
||||||
|
|
||||||
|
echo ➡️ Make new DIST folder structure
|
||||||
|
mkdir "dist"
|
||||||
|
mkdir "dist\data"
|
||||||
|
mkdir "dist\data\attachments"
|
||||||
|
mkdir "dist\app"
|
||||||
|
echo ✅ New DIST structur created
|
||||||
|
|
||||||
|
echo ➡️ Copy APP files
|
||||||
|
robocopy backend dist\app /S /XD tests scripts /XF composer.*
|
||||||
|
robocopy frontend\dist dist\app\public /S
|
||||||
|
echo ✅ APP files copied
|
||||||
|
|
||||||
|
echo ➡️ Packaging build
|
||||||
|
for /f "tokens=2 delims=:" %%a in ('findstr /c:"\"version\"" frontend\package.json') do (
|
||||||
|
set ver=%%a
|
||||||
|
set ver=!ver: =!
|
||||||
|
set ver=!ver:"=!
|
||||||
|
set ver=!ver:,=!
|
||||||
|
)
|
||||||
|
echo 👉 Version: %ver%
|
||||||
|
cd dist
|
||||||
|
tar -a -c -f ..\build\BugReport.%ver%.zip *
|
||||||
|
cd ..
|
||||||
|
echo ✅ Build packaged
|
||||||
|
|
||||||
|
echo 🚀 Done.
|
||||||
@ -8,7 +8,7 @@ const require = createRequire(import.meta.url);
|
|||||||
const pkg = require("./package.json");
|
const pkg = require("./package.json");
|
||||||
|
|
||||||
const subpath = "/bugreport/";
|
const subpath = "/bugreport/";
|
||||||
export const baseUrl = subpath + "webapp/dist/";
|
export const baseUrl = "/"; //subpath + "frontend/dist/";
|
||||||
|
|
||||||
// https://vite.dev/config/
|
// https://vite.dev/config/
|
||||||
export default defineConfig(({ command, mode }) => {
|
export default defineConfig(({ command, mode }) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user