I have not a default setup vue + laravel, vue completely separately from laravel.
In my case laravel only as API. I finished doing a vue app and did a build command for production.
I got the generated resources in this form:
I was thinking about how to upload to the hosting such an application and came to the conclusion that i need to send vue files through my laravel server.
I wrote route in routes/web.php:
Route::get('{uri}', function ($uri = '/') {
$sourceByUri = public_path('_frontend/' . $uri);
if (is_file($sourceByUri)) {
return file_get_contents($sourceByUri);
}
$indexSpa = public_path('/_frontend/index.html');
return file_get_contents($indexSpa);
})->where('uri', '.*');
My api works as it should, but the files from the folder _frontend are not sent correctly(css not applicable). Screenshot
Should be like this: Screenshot
It turned out that all responses from the server are worth Content-Type: text/html
How do I properly open my application through a server?

Content-Type: text/html, I tried changingContent-Typetotext/cssand it all worked, but at the same time all responses withtext/css(html, css, other files). Screenshotmime_content_type($sourceByUri)but for css and js it returnstext/plain