Skip to content
This repository has been archived by the owner on Aug 5, 2019. It is now read-only.

Commit

Permalink
Merge pull request #19 from jrit/master
Browse files Browse the repository at this point in the history
filerev and cache-control headers
  • Loading branch information
jrit committed Aug 18, 2015
2 parents 70405db + de0203e commit e98ef9f
Show file tree
Hide file tree
Showing 8 changed files with 63 additions and 16 deletions.
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,22 @@ require( "load-grunt-config" )( grunt, {

## Changelog

#### 3.0.0 Run jshint with tests, fail drone builds
#### 4.0.0 [Breaking Changes] Cache and versioning changes

To upgrade:

- remove all `?v={{ VERSION }}` strings from your project
- `npm install grunt-filerev --save`
- `npm install grunt-filerev-replace --save`


#### 3.0.0 [Breaking Changes] Run jshint with tests, fail drone builds

To upgrade, make sure the jshint report you get when running local tests comes back clean. Projects that may have previously passed on drone will now fail if they have jshint errors.

Additionally, jshint will no longer fail tasks during `grunt watch`.


#### 2.4.2 More minification, deferred JS loading, optimize workflow

To upgrade, replace all `script` tag logic at the bottom of your `index.html` file with the following:
Expand Down
10 changes: 8 additions & 2 deletions grunt/aliases.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ test:
- envUseSource
- clean:build
- buildcore
- rev
- instrument
- protractor_coverage:local
- envDontUseSource
Expand All @@ -33,6 +34,7 @@ teststack:
- envUseSource
- clean:build
- buildcore
- rev
- jshint:deploy
- instrument
- localstack
Expand All @@ -41,19 +43,23 @@ teststack:
- buildcore
- makeReport

rev:
- filerev
- filerev_replace

deploystaging:
- envStaging
- envUseDist
- deploy

deployprod:
- envProd
- envUseDist
- deploy

deploy:
- envUseDist
- clean
- buildcore
- rev
- clean:modules
- babel
- uglify
Expand Down
9 changes: 9 additions & 0 deletions grunt/filerev.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module.exports = {
options: {
algorithm: "md5",
length: 8
},
resources: {
src: "build/**/*.{jpg,jpeg,gif,png,webp,svg,js,css}"
}
};
14 changes: 14 additions & 0 deletions grunt/filerev_replace.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module.exports = {
options: {
assets_root: ""
},
compiled_assets: {
src: "build/**/*.{js,css}"
},
views: {
options: {
views_root: ""
},
src: "build/index.html"
}
};
4 changes: 2 additions & 2 deletions grunt/postcss.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
module.exports = {
options: {
processors: [
require( "autoprefixer-core" )( { browsers: "IE >= 9, > 1%" } ),
require( "autoprefixer-core" )( { browsers: "IE >= 9, > 1%" } )
]
},
build: {
src: "build/project.css"
}
};
};
4 changes: 0 additions & 4 deletions grunt/replace.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
"use strict";

var replacements = [
{
from: "{{ VERSION }}",
to: "<%= version %>"
},
{
from: "{{ APIROOT }}",
to: "<%= APIRoot %>"
Expand Down
14 changes: 12 additions & 2 deletions grunt/s3.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,18 @@ module.exports = {
bucket: "<%= aws.s3Bucket %>"
},
build: {
options : {
headers: {
CacheControl: 31536000
}
},
cwd: "build/",
src: "**",
src: [ "**", "!**.html" ],
dest: "build-<%= version %>/build/"
},
index: {
cwd: "build/",
src: "**.html",
dest: "build-<%= version %>/build/"
}
};
};
12 changes: 7 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
{
"name": "dominatr-grunt",
"version": "3.0.0",
"version": "4.0.0",
"description": "Build all the things!",
"scripts": {
"test": ""
},
"repository": {
"type": "git",
"url": "git+https://github.com/vokal/grunt-dominatr.git"
"url": "git+https://github.com/vokal/dominatr-grunt.git"
},
"author": "Vokal",
"bugs": {
"url": "https://github.com/vokal/grunt-dominatr/issues"
"url": "https://github.com/vokal/dominatr-grunt/issues"
},
"homepage": "https://github.com/vokal/grunt-dominatr#readme",
"dependencies": {}
"homepage": "https://github.com/vokal/dominatr-grunt#readme",
"dependencies": {
"autoprefixer-core": "^5.2.1"
}
}

0 comments on commit e98ef9f

Please sign in to comment.