/public/css and /public/js to be gitignored already on fresh laravel project #42612
Replies: 5 comments 14 replies
-
Question: if you ignore (re)builded assets in public, how to do you handle the release? I ask because we are using git pull for releasing on servers, so we need all of these files. |
Beta Was this translation helpful? Give feedback.
-
For me this is a bad option, in many products we generate the assets on development servers and commit it to be push to production server. |
Beta Was this translation helpful? Give feedback.
-
By the relatively small sample size in this discussion I'd say it's more common to build assets outside of the production environment, and then publish them that way. Which is weird because I've always built assets for production on the production environment using Different strokes for different folks, I guess. It does seem like a pain to add them to gitignore for every project, but realistically, how often are you creating new laravel projects, and why don't you have a custom gitignore ready to paste in if this is the case? Like this one for example: https://gist.github.com/Michael-Stokoe/812dcc2257b6b62adfd49e8a7d06438c |
Beta Was this translation helpful? Give feedback.
-
I prefer to install git and commit compiled assets instead of deploy single files..... I say this because we CANNOT have CI/CD because ... too difficult ? too lazy ? ... every other ideas is still valid |
Beta Was this translation helpful? Give feedback.
-
While I have to admit that I, too, am guilty of the sin of compiling assets on development, pushing them to git, then pulling them to the production environment, my ideal situation would probably be:
So, obviously, you need two different sets of |
Beta Was this translation helpful? Give feedback.
-
It's like every time I create a new project I seem to forget to gitignore those 2 build paths, and it almost always ends up git-conflicting in my projects.
So, I think that it will be better to be ignored those two paths by default.
Is there any reason why should you want not to gitignore them?
The only thing I can think of is when you don't opt for resources/css and mix.js and write directly in the public/css/[something].css which I think of as an antipattern.
So, what are your thoughts about it?
Beta Was this translation helpful? Give feedback.
All reactions