mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
dev building and optimized builds work
This commit is contained in:
@@ -9,7 +9,7 @@ module.exports = function(config) {
|
||||
files : [
|
||||
{
|
||||
expand: true,
|
||||
cwd: '<%= tempDir %>',
|
||||
cwd: '<%= destDir %>',
|
||||
src: ['**/*'],
|
||||
dest: '<%= pkg.name %>-<%= pkg.version %>/',
|
||||
},
|
||||
|
||||
@@ -27,11 +27,11 @@ module.exports = function(config) {
|
||||
|
||||
js: {
|
||||
src: [
|
||||
'<%= destDir %>/vendor/requirejs/require.js',
|
||||
'<%= destDir %>/app/components/require.config.js',
|
||||
'<%= destDir %>/app/app.js',
|
||||
'<%= tempDir %>/vendor/requirejs/require.js',
|
||||
'<%= tempDir %>/app/components/require.config.js',
|
||||
'<%= tempDir %>/app/app.js',
|
||||
],
|
||||
dest: '<%= destDir %>/app/app.js'
|
||||
dest: '<%= genDir %>/app/app.js'
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
@@ -8,7 +8,7 @@ module.exports = function(config) {
|
||||
dest: '<%= tempDir %>'
|
||||
},
|
||||
|
||||
everything_but_less: {
|
||||
public_to_gen: {
|
||||
cwd: '<%= srcDir %>',
|
||||
expand: true,
|
||||
src: ['**/*', '!**/*.less'],
|
||||
|
||||
@@ -2,9 +2,9 @@ module.exports = function(config) {
|
||||
return {
|
||||
build: {
|
||||
expand: true,
|
||||
cwd: '<%= tempDir %>',
|
||||
cwd: '<%= genDir %>',
|
||||
src: '**/*.css',
|
||||
dest: '<%= tempDir %>'
|
||||
dest: '<%= genDir %>'
|
||||
}
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -6,16 +6,16 @@ module.exports = function(config) {
|
||||
length: 8,
|
||||
},
|
||||
cssDark: {
|
||||
src: '<%= destDir %>/css/grafana.dark.min.css',
|
||||
dest: '<%= destDir %>/css'
|
||||
src: '<%= genDir %>/css/grafana.dark.min.css',
|
||||
dest: '<%= genDir %>/css'
|
||||
},
|
||||
cssLight: {
|
||||
src: '<%= destDir %>/css/grafana.light.min.css',
|
||||
dest: '<%= destDir %>/css'
|
||||
src: '<%= genDir %>/css/grafana.light.min.css',
|
||||
dest: '<%= genDir %>/css'
|
||||
},
|
||||
js: {
|
||||
src: '<%= destDir %>/app/app.js',
|
||||
dest: '<%= destDir %>/app'
|
||||
src: '<%= genDir %>/app/app.js',
|
||||
dest: '<%= genDir %>/app'
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
@@ -6,13 +6,13 @@ module.exports = function(config) {
|
||||
collapseWhitespace: true
|
||||
},
|
||||
expand: true,
|
||||
cwd: '<%= tempDir %>',
|
||||
cwd: '<%= genDir %>',
|
||||
src: [
|
||||
//'index.html',
|
||||
'app/panels/**/*.html',
|
||||
'app/partials/**/*.html'
|
||||
],
|
||||
dest: '<%= tempDir %>'
|
||||
dest: '<%= genDir %>'
|
||||
}
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -2,7 +2,7 @@ module.exports = function(config) {
|
||||
return {
|
||||
build: {
|
||||
expand: true,
|
||||
cwd:'<%= tempDir %>',
|
||||
cwd:'<%= genDir %>',
|
||||
src: [
|
||||
'app/controllers/**/*.js',
|
||||
'app/plugins/**/*.js',
|
||||
@@ -15,7 +15,7 @@ module.exports = function(config) {
|
||||
'app/app.js',
|
||||
'vendor/angular/**/*.js',
|
||||
],
|
||||
dest: '<%= tempDir %>'
|
||||
dest: '<%= genDir %>'
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
module.exports = function(config) {
|
||||
return {
|
||||
grafana: {
|
||||
cwd: '<%= tempDir %>',
|
||||
cwd: '<%= genDir %>',
|
||||
src: ['app/**/*.html'],
|
||||
dest: '<%= tempDir %>/app/components/partials.js',
|
||||
dest: '<%= genDir %>/app/components/partials.js',
|
||||
options: {
|
||||
bootstrap: function(module, script) {
|
||||
return "define('components/partials', ['angular'], function(angular) { \n" +
|
||||
|
||||
@@ -4,10 +4,10 @@ module.exports = function(config,grunt) {
|
||||
function buildRequireJsOptions() {
|
||||
|
||||
var options = {
|
||||
appDir: '<%= tempDir %>',
|
||||
dir: '<%= destDir %>',
|
||||
mainConfigFile: '<%= tempDir %>/app/components/require.config.js',
|
||||
baseUrl: 'app_gen',
|
||||
appDir: '<%= genDir %>',
|
||||
dir: '<%= tempDir %>',
|
||||
mainConfigFile: '<%= genDir %>/app/components/require.config.js',
|
||||
baseUrl: 'app',
|
||||
waitSeconds: 0,
|
||||
|
||||
modules: [], // populated below,
|
||||
@@ -74,7 +74,7 @@ module.exports = function(config,grunt) {
|
||||
];
|
||||
|
||||
var fs = require('fs');
|
||||
var panelPath = config.srcDir+'/app/panels';
|
||||
var panelPath = config.genDir+'/app/panels';
|
||||
|
||||
// create a module for each directory in public/app/panels/
|
||||
fs.readdirSync(panelPath).forEach(function (panelName) {
|
||||
|
||||
@@ -2,9 +2,9 @@ module.exports = function(config) {
|
||||
return {
|
||||
dest: {
|
||||
expand: true,
|
||||
src: ['**/*.js', '!dashboards/*.js', '!vendor/jquery/**/*.js'],
|
||||
dest: '<%= destDir %>',
|
||||
cwd: '<%= destDir %>',
|
||||
src: ['**/*.js', '!dashboards/*.js', '!vendor/**/*.js'],
|
||||
dest: '<%= genDir %>',
|
||||
cwd: '<%= genDir %>',
|
||||
options: {
|
||||
quite: true,
|
||||
compress: {},
|
||||
|
||||
@@ -3,10 +3,11 @@ module.exports = function() {
|
||||
|
||||
return {
|
||||
html: [
|
||||
'<%= destDir %>/views/index.html',
|
||||
'<%= genDir %>/views/index.html',
|
||||
'<%= genDir %>/views/500.html',
|
||||
],
|
||||
options: {
|
||||
assetsDirs: ['<%= destDir %>'],
|
||||
assetsDirs: ['<%= genDir %>'],
|
||||
patterns: {
|
||||
css: [
|
||||
[/(\.css)/, 'Replacing reference to image.png']
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
module.exports = function(config) {
|
||||
return {
|
||||
html: [
|
||||
'tmp/index.html',
|
||||
]
|
||||
};
|
||||
};
|
||||
@@ -10,7 +10,7 @@ module.exports = function(config) {
|
||||
|
||||
copy_to_gen: {
|
||||
files: ['<%= srcDir %>/**/*', '!<%= srcDir %>/**/*.less'],
|
||||
tasks: ['copy:everything_but_less'],
|
||||
tasks: ['copy:public_to_gen'],
|
||||
options: {
|
||||
spawn: false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user