3

Deploy laravel vue app in shared hosting

I coppied index.js from public folder to root and changed autoload and bootstrap path.

public folder contains-

dist/css/app.css
dist/js/app.js
mix-manifest.json

mix-manifest.json

{
    "/dist/js/app.js": "/dist/js/app.js",
    "/dist/css/app.css": "/dist/css/app.css"
}

when i browse, http://domain_name/dist/css/app.css not found error

I deleted public folder and coppied everything to root. But i m getting The Mix manifest does not exist error

Is there a way to overcome this.?

Deploying laravel vue app is a headache? Can i use RewriteBase in htaccess to resolve issue

I can deploy laravel to shared hosting. but using vue in frontend seems not working as expected. I used vue-routes in frontend for routing rather than laravel routes

nithin k
  • 45
  • 1
  • 6

1 Answers1

0

I'm not an expert but I'm doing it this way

  • npm run prod to compile assets for production
  • create a folder in the root directory in the shared host and copy all project files to it
  • move project's public folder contents to public_html folder
  • Edit index.php file and change autoload and bootstrap paths to point project folder
  • Create a symlink to the image folder ex

symlink('home/username/project_name/public/img','home/username/public_html/img');

  • create a database and username in CPanel and add to .env file
  • import data to database.
Garry
  • 2,256
  • 2
  • 11
  • 14
  • I followed exactly same method. but when i use vue js in frontend this method doesn't work with routes specified in vue – nithin k Dec 02 '19 at 15:37
  • Ok i willl update the question. but its working perfectly in local computer with php artisan serve. When i move all contents of public folder to root and edit index.php, it throws mix-manifest not found error. I think their is no issue in route file and i followed the offcial doc as well – nithin k Dec 03 '19 at 03:48
  • 1
    this will help you https://stackoverflow.com/questions/45153738/the-mix-manifest-does-not-exist-when-it-does-exist – Garry Dec 03 '19 at 09:03
  • ok thanks. but in my case the mix mainfest is in public_html folder and not inside public folder. so in this case the accepted answer is not the solution – nithin k Dec 06 '19 at 04:41