mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
improved asset (css/js) build pipeline, added revision to css and js. Will remove issues related to the browser cache when upgrading grafana and improve load performance (Fixes #418)
This commit is contained in:
@@ -2,7 +2,7 @@ module.exports = function(config) {
|
||||
return {
|
||||
grafana: {
|
||||
cwd: '<%= tempDir %>',
|
||||
src: 'app/partials/**/*.html',
|
||||
src: ['app/**/*.html', '!app/panels/*/module.html'],
|
||||
dest: '<%= tempDir %>/app/components/partials.js',
|
||||
options: {
|
||||
bootstrap: function(module, script) {
|
||||
|
||||
@@ -61,9 +61,6 @@ module.exports = function(config,grunt) {
|
||||
'jquery.flot.pie',
|
||||
'angular-sanitize',
|
||||
'angular-dragdrop',
|
||||
'panels/graphite/module',
|
||||
'panels/text/module',
|
||||
'panels/timepicker/module'
|
||||
]
|
||||
}
|
||||
];
|
||||
@@ -73,19 +70,8 @@ module.exports = function(config,grunt) {
|
||||
|
||||
// create a module for each directory in src/app/panels/
|
||||
fs.readdirSync(panelPath).forEach(function (panelName) {
|
||||
if(!grunt.file.exists(panelPath+'/'+panelName+'/module.js')) {
|
||||
fs.readdirSync(panelPath+"/"+panelName).forEach(function (subName) {
|
||||
requireModules.push({
|
||||
name: 'panels/'+panelName+'/'+subName+'/module',
|
||||
exclude: ['app']
|
||||
});
|
||||
})
|
||||
} else {
|
||||
requireModules.push({
|
||||
name: 'panels/'+panelName+'/module',
|
||||
exclude: ['app']
|
||||
});
|
||||
}
|
||||
requireModules[0].include.push('panels/'+panelName+'/module');
|
||||
requireModules[0].include.push('text!panels/'+panelName+'/module.html');
|
||||
});
|
||||
|
||||
// exclude the literal config definition from all modules
|
||||
|
||||
Reference in New Issue
Block a user