When creating a website (for clarity, only an HTML / JS website) I use gulp to compile and concatenate some files, which are then placed in the build/ folder.
The folder structure looks something like this:
βββ assets β βββ images β βββ javascripts β β βββ app.js β βββ stylesheets β βββ style.scss βββ bower.json βββ build β βββ bower_components β βββ images β βββ index.html β βββ scripts.min.js β βββ styles.min.css βββ gulpfile.js βββ index.html βββ node_modules β βββ gulp-module-1 β βββ gulp-module-2 βββ package.json βββ README
If I include all these files in the git repository, all my changes will be committed twice. That is: a change in assets/stylesheets/style.scss will also lead to a change in build/styles.min.css . However, if I decided to exclude the build/ folder from the repository, you will need certain development tools on the production server (for example, gulp, npm, etc.). Sometimes this can be difficult when there are limited privileges on the production server. Obviously, excluding the assets/ folder is not an option, since you will lose the source for the compiled files.
So my question is: what is considered best practice for deployment to a production server? Do you include the build/ folder in the repo, are you compiling the build/ folder on the production server, or is there a third solution?
git gulp
Diederik
source share