mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
trying to get css, and js build file revisioning working
This commit is contained in:
@@ -6,11 +6,13 @@ module.exports = function(grunt) {
|
||||
'jshint:tests',
|
||||
'clean:on_start',
|
||||
'less:src',
|
||||
'concat:css',
|
||||
'copy:everything_but_less_to_temp',
|
||||
'htmlmin:build',
|
||||
'cssmin:build',
|
||||
'ngmin:build',
|
||||
'requirejs:build',
|
||||
'filerev',
|
||||
'clean:temp',
|
||||
'build:write_revision',
|
||||
'uglify:dest'
|
||||
@@ -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
|
||||
grunt.registerTask('build:write_revision', function() {
|
||||
grunt.event.once('git-describe', function (desc) {
|
||||
|
||||
grunt.config('string-replace.config', {
|
||||
files: {
|
||||
'<%= destDir %>/app/components/require.config.js': '<%= destDir %>/app/components/require.config.js',
|
||||
@@ -41,4 +44,4 @@ module.exports = function(grunt) {
|
||||
});
|
||||
grunt.task.run('git-describe');
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
13
tasks/options/filerev.js
Normal file
13
tasks/options/filerev.js
Normal file
@@ -0,0 +1,13 @@
|
||||
module.exports = function(config) {
|
||||
return {
|
||||
options: {
|
||||
encoding: 'utf8',
|
||||
algorithm: 'md5',
|
||||
length: 8,
|
||||
},
|
||||
css: {
|
||||
src: '<%= srcDir %>/css/default.min.css',
|
||||
dest: '<%= destDir %>/css'
|
||||
}
|
||||
};
|
||||
};
|
||||
8
tasks/options/usemin.js
Normal file
8
tasks/options/usemin.js
Normal file
@@ -0,0 +1,8 @@
|
||||
module.exports = function(config) {
|
||||
return {
|
||||
html: '<%= destDir %>/index.html',
|
||||
options: {
|
||||
assetsDirs: ['<%= destDir %>/css/']
|
||||
}
|
||||
};
|
||||
};
|
||||
5
tasks/options/useminPrepare.js
Normal file
5
tasks/options/useminPrepare.js
Normal file
@@ -0,0 +1,5 @@
|
||||
module.exports = function(config) {
|
||||
return {
|
||||
html: 'tmp/index.html',
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user