Thursday, March 16, 2017

How can i manage frontend assets with laravel mix and git?

I'm using Mix (this applies to Elixir as well i guess) to manage my frontend assets. I have Mix configured to version files in production but not in dev. As such, when i update assets, i get updated app.js and app.css files in dev and app.{hash}.js and app.{hash}.css files in production.

What is your advice on how to leverage this with version control?

  1. Put the files in version control? If so how do i manage the constant changes during development? Keep adding new hashed files? Do i leave app.js and app.css on the production server?
  2. .gitignore the js and css files and run npm on the production server to compile the assets locally?
  3. Some other solution?

What are your thoughts on this?

Thanks in advance.



via Gonçalo Marrafa

Advertisement