mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
fixing build with subfolders
This commit is contained in:
parent
5fc0f39474
commit
4c7f52797f
@ -22,7 +22,7 @@ module.exports = function (grunt) {
|
|||||||
var key = option.replace(/\.js$/,'');
|
var key = option.replace(/\.js$/,'');
|
||||||
// If key already exists, extend it. It is your responsibility to avoid naming collisions
|
// If key already exists, extend it. It is your responsibility to avoid naming collisions
|
||||||
config[key] = config[key] || {};
|
config[key] = config[key] || {};
|
||||||
grunt.util._.extend(config[key], require(path + option)(config));
|
grunt.util._.extend(config[key], require(path + option)(config,grunt));
|
||||||
});
|
});
|
||||||
// technically not required
|
// technically not required
|
||||||
return config;
|
return config;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
module.exports = function(config) {
|
module.exports = function(config,grunt) {
|
||||||
var _c = {
|
var _c = {
|
||||||
build: {
|
build: {
|
||||||
options: {
|
options: {
|
||||||
@ -63,15 +63,24 @@ module.exports = function(config) {
|
|||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
|
var fs = require('fs');
|
||||||
|
var panelPath = config.srcDir+'/app/panels'
|
||||||
|
|
||||||
// create a module for each directory in src/app/panels/
|
// create a module for each directory in src/app/panels/
|
||||||
require('fs')
|
fs.readdirSync(panelPath).forEach(function (panelName) {
|
||||||
.readdirSync(config.srcDir+'/app/panels')
|
if(!grunt.file.exists(panelPath+'/'+panelName+'/module.js')) {
|
||||||
.forEach(function (panelName) {
|
fs.readdirSync(panelPath+"/"+panelName).forEach(function (subName) {
|
||||||
|
requireModules.push({
|
||||||
|
name: 'panels/'+panelName+'/'+subName+'/module',
|
||||||
|
exclude: ['app']
|
||||||
|
}); })
|
||||||
|
} else {
|
||||||
requireModules.push({
|
requireModules.push({
|
||||||
name: 'panels/'+panelName+'/module',
|
name: 'panels/'+panelName+'/module',
|
||||||
exclude: ['app']
|
exclude: ['app']
|
||||||
});
|
});
|
||||||
});
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// exclude the literal config definition from all modules
|
// exclude the literal config definition from all modules
|
||||||
requireModules
|
requireModules
|
||||||
|
@ -2,7 +2,7 @@ module.exports = function(config) {
|
|||||||
return {
|
return {
|
||||||
dest: {
|
dest: {
|
||||||
expand: true,
|
expand: true,
|
||||||
src: ['**/*.js', '!config.js', '!app/dashboards/*.js'],
|
src: ['**/*.js', '!config.js', '!app/dashboards/*.js', '!app/dashboards/**/*.js',],
|
||||||
dest: '<%= destDir %>',
|
dest: '<%= destDir %>',
|
||||||
cwd: '<%= destDir %>',
|
cwd: '<%= destDir %>',
|
||||||
options: {
|
options: {
|
||||||
|
Loading…
Reference in New Issue
Block a user