0

I have an app (built with laravel) which i deployed it and working very well, but i have a question, when i deploy it the server i made these process :

1- minify css and js files and comine them in a single file

2- changing some configuration (database,hostname,mail sever ,etc ...)

3- Finally i upload my files to the server.

how can i return back to my local config and unminify my js and css files without doing it manually ?

is there a better way to make it automated ? i know that the first step can be done by gulp or any javascript task runner by a single command and the second one is not a big deal ,but i just want to know if there an automated way?

wahdan
  • 1,208
  • 3
  • 16
  • 26

1 Answers1

0

Why don't you just have a .env config file out of you version control and compress your CSS/JS using Laravel Mix as a part of your deploy process?

To make it clear:

  1. Keep your .env file in .gitignore. Thus you have to setup your environment settings only once (database, hostname, etc).

  2. Use npm run prod to minify your CSS/JS: https://laravel.com/docs/5.4/mix

Pave
  • 2,347
  • 4
  • 21
  • 23