Skip to content

Commit

Permalink
Use broccoli-asset-rev instead of grunt hashre.
Browse files Browse the repository at this point in the history
  • Loading branch information
abuiles committed May 25, 2014
1 parent b28fffc commit 12b23d5
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 30 deletions.
3 changes: 0 additions & 3 deletions build.sh
Expand Up @@ -24,9 +24,6 @@ boldMessage 4 "Building Ember app"
cd client
ember build --environment production

boldMessage 4 "Running grunt hashres"
grunt hashres

cd ../

rm -rf public/ember-assets
Expand Down
14 changes: 13 additions & 1 deletion client/Brocfile.js
Expand Up @@ -68,4 +68,16 @@ app.import('vendor/rails-csrf/dist/named-amd/main.js', {
app.import('vendor/ember-test-helpers/dist/ember-test-helpers.js');
app.import('vendor/_amdize.js');

module.exports = app.toTree();

var tree = app.toTree();

if (app.env === 'production') {
var assetRev = require('broccoli-asset-rev');

tree = assetRev(tree, {
fingerprintExtensions: ['js', 'css', 'png', 'jpg', 'gif'],
replaceExtensions: ['html', 'js', 'css']
});
}

module.exports = tree;
26 changes: 1 addition & 25 deletions client/Gruntfile.js
@@ -1,27 +1,3 @@
module.exports = function(grunt) {
grunt.initConfig({
hashres: {
// Global options
options: {
encoding: 'utf8',
fileNameFormat: '${hash}.${name}.cache.${ext}',
renameFiles: true
},
prod: {
options: {
},
src: [
'dist/assets/*.js',
'dist/assets/*.css'
],
dest: 'dist/index.html'
},
images: {
src: [
'dist/assets/images/*'
],
dest: ['dist/assets/*.css', 'dist/assets/*.js']
}
}});
grunt.loadNpmTasks('grunt-hashres');
grunt.initConfig({});
};
1 change: 0 additions & 1 deletion client/package.json
Expand Up @@ -32,7 +32,6 @@
"dependencies": {
"broccoli-fingerprint": "0.0.3",
"grunt": "^0.4.5",
"grunt-hashres": "^0.4.1",
"http-proxy": "^1.1.4"
}
}

0 comments on commit 12b23d5

Please sign in to comment.