Commit 36b1dce7 by Torkel Ödegaard

trying to get css, and js build file revisioning working

parent 877ef36b
...@@ -55,6 +55,8 @@ ...@@ -55,6 +55,8 @@
}, },
"license": "Apache License", "license": "Apache License",
"dependencies": { "dependencies": {
"grunt-contrib-concat": "^0.4.0" "grunt-contrib-concat": "^0.4.0",
"grunt-filerev": "^0.2.1",
"grunt-usemin": "^2.1.1"
} }
} }
...@@ -6,11 +6,13 @@ module.exports = function(grunt) { ...@@ -6,11 +6,13 @@ module.exports = function(grunt) {
'jshint:tests', 'jshint:tests',
'clean:on_start', 'clean:on_start',
'less:src', 'less:src',
'concat:css',
'copy:everything_but_less_to_temp', 'copy:everything_but_less_to_temp',
'htmlmin:build', 'htmlmin:build',
'cssmin:build', 'cssmin:build',
'ngmin:build', 'ngmin:build',
'requirejs:build', 'requirejs:build',
'filerev',
'clean:temp', 'clean:temp',
'build:write_revision', 'build:write_revision',
'uglify:dest' 'uglify:dest'
...@@ -19,6 +21,7 @@ module.exports = function(grunt) { ...@@ -19,6 +21,7 @@ module.exports = function(grunt) {
// run a string replacement on the require config, using the latest revision number as the cache buster // run a string replacement on the require config, using the latest revision number as the cache buster
grunt.registerTask('build:write_revision', function() { grunt.registerTask('build:write_revision', function() {
grunt.event.once('git-describe', function (desc) { grunt.event.once('git-describe', function (desc) {
grunt.config('string-replace.config', { grunt.config('string-replace.config', {
files: { files: {
'<%= destDir %>/app/components/require.config.js': '<%= destDir %>/app/components/require.config.js', '<%= destDir %>/app/components/require.config.js': '<%= destDir %>/app/components/require.config.js',
...@@ -41,4 +44,4 @@ module.exports = function(grunt) { ...@@ -41,4 +44,4 @@ module.exports = function(grunt) {
}); });
grunt.task.run('git-describe'); grunt.task.run('git-describe');
}); });
}; };
\ No newline at end of file
module.exports = function(config) {
return {
options: {
encoding: 'utf8',
algorithm: 'md5',
length: 8,
},
css: {
src: '<%= srcDir %>/css/default.min.css',
dest: '<%= destDir %>/css'
}
};
};
module.exports = function(config) {
return {
html: '<%= destDir %>/index.html',
options: {
assetsDirs: ['<%= destDir %>/css/']
}
};
};
module.exports = function(config) {
return {
html: 'tmp/index.html',
};
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment