diff --git a/README.md b/README.md index 706e574..fefcb13 100644 --- a/README.md +++ b/README.md @@ -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: diff --git a/grunt/aliases.yaml b/grunt/aliases.yaml index ec3c2d2..65e7b95 100644 --- a/grunt/aliases.yaml +++ b/grunt/aliases.yaml @@ -21,6 +21,7 @@ test: - envUseSource - clean:build - buildcore + - rev - instrument - protractor_coverage:local - envDontUseSource @@ -33,6 +34,7 @@ teststack: - envUseSource - clean:build - buildcore + - rev - jshint:deploy - instrument - localstack @@ -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 diff --git a/grunt/filerev.js b/grunt/filerev.js new file mode 100644 index 0000000..83e9c13 --- /dev/null +++ b/grunt/filerev.js @@ -0,0 +1,9 @@ +module.exports = { + options: { + algorithm: "md5", + length: 8 + }, + resources: { + src: "build/**/*.{jpg,jpeg,gif,png,webp,svg,js,css}" + } +}; diff --git a/grunt/filerev_replace.js b/grunt/filerev_replace.js new file mode 100644 index 0000000..b13468a --- /dev/null +++ b/grunt/filerev_replace.js @@ -0,0 +1,14 @@ +module.exports = { + options: { + assets_root: "" + }, + compiled_assets: { + src: "build/**/*.{js,css}" + }, + views: { + options: { + views_root: "" + }, + src: "build/index.html" + } +}; diff --git a/grunt/postcss.js b/grunt/postcss.js index 25de760..07670f1 100644 --- a/grunt/postcss.js +++ b/grunt/postcss.js @@ -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" } -}; \ No newline at end of file +}; diff --git a/grunt/replace.js b/grunt/replace.js index 17a6ff8..d4829a2 100644 --- a/grunt/replace.js +++ b/grunt/replace.js @@ -1,10 +1,6 @@ "use strict"; var replacements = [ - { - from: "{{ VERSION }}", - to: "<%= version %>" - }, { from: "{{ APIROOT }}", to: "<%= APIRoot %>" diff --git a/grunt/s3.js b/grunt/s3.js index 9ca423b..e75eace 100644 --- a/grunt/s3.js +++ b/grunt/s3.js @@ -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/" } -}; \ No newline at end of file +}; diff --git a/package.json b/package.json index 63e5402..cd48dad 100644 --- a/package.json +++ b/package.json @@ -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" + } }