the-a-train
the-a-train

Reputation: 1143

git deploy minified assets only

How can I create a simple deployment process using git where only my minified/concatenated js/css files are on the production server?

I am building an angularjs/laravel app with bootstrap-sass and ideally don't want to deploy any un-minified (source) files if possible. I am using bower and gulp tools as well if that helps.

Upvotes: 1

Views: 337

Answers (1)

Ben Diamant
Ben Diamant

Reputation: 6206

The idea is to have 2 sections in your code base:

  1. All the files you use for development - js, css, htmls etc (with their folder structure)
  2. A folder called 'Dist' (stand for distributed)

And have a grunt task (let's call it 'grunt build') that perform set of tasks over your development code base: minified, uglified, image compression, removes unnecessary file and put the output in Dist.

Once grunt build is done, you need to deploy the Dist folder to production, that can be done in many ways (holding a separate git repo for production is and every new commit is a new version is a good option)

Upvotes: 2

Related Questions