By for now I develop monolith project. The main problem is that requests take a lot of time and they executes not in async mode.
All requests are in web.php.
vite.config.js
import { defineConfig } from "vite";
import laravel from "laravel-vite-plugin";
import react from "@vitejs/plugin-react";
import path from "path";
import { resolve } from "node:path";
import tsconfigPaths from "vite-tsconfig-paths";
export default defineConfig({
server: {
host: "localhost",
},
plugins: [
laravel({
input: ["resources/ts/main.tsx"],
}),
react(),
tsconfigPaths(),
],
resolve: {
alias: [
{
find: "@",
replacement: resolve(__dirname, "./resources/ts"),
components: `${path.resolve(__dirname, "./resources/ts/Components")}`,
public: `${path.resolve(__dirname, "./public/")}`,
pages: path.resolve(__dirname, "./resources/ts/Pages"),
types: `${path.resolve(__dirname, "./resources/ts/@types")}`,
},
],
},
});
Example of web.php
// Route to authenticate user
Route::post('/login', [UserAuth::class, 'authenticateUser']);
// Route to return view files (tsx)
Route::get('/{any}', function () {
return view('welcome');
})->where('any', '.*');
I know that provided info won’t be enough, but hope you will help me!
Additional info I’ll provide as soon as I can!
Problem solves a half when I boot my project on Laravel Octane throw OpenSwoole server. But I think, that it’s incorrect and I need to change something in code, but by for now nothing helps.
Also tryied move some request into api.php, but it also didn’t helps
Zakhar_627 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.