fix(dashboard/build): update gruntfile for release build

This commit is contained in:
Ed Rooth 2014-04-14 11:12:19 -07:00
parent ef99b9ac49
commit c08bcb6f5b
2 changed files with 26 additions and 9 deletions

View File

@ -1,5 +1,7 @@
'use strict'; 'use strict';
var util = require('util');
module.exports = function(grunt) { module.exports = function(grunt) {
/*jshint maxstatements:false */ /*jshint maxstatements:false */
@ -37,7 +39,10 @@ module.exports = function(grunt) {
concurrent: { concurrent: {
dev: { dev: {
tasks: ['watch', /*'test-watch'*/], tasks: [
'watch',
//'test-watch'
],
options: { options: {
logConcurrentOutput: true logConcurrentOutput: true
} }
@ -194,6 +199,17 @@ module.exports = function(grunt) {
dest: '<%= config.distPath %>/img' dest: '<%= config.distPath %>/img'
}] }]
}, },
'coreos-web': {
files: [{
cwd: '<%= config.appPath %>/coreos-web',
expand: true,
src: [
'fonts/*',
'img/*'
],
dest: '<%= config.distPath %>/coreos-web'
}]
},
'dist-static': { 'dist-static': {
files: [ files: [
{ {
@ -229,7 +245,7 @@ module.exports = function(grunt) {
grunt.registerTask('clean-paths', 'clean up resource paths', function() { grunt.registerTask('clean-paths', 'clean up resource paths', function() {
grunt.log.writeln('cleaning paths...'); grunt.log.writeln('cleaning paths...');
function clean(path) { function clean(path) {
return path.replace('cp/static/', ''); return path.replace('mod/dashboard/static/', '');
} }
['concat', 'uglify', 'cssmin'].forEach(function(task) { ['concat', 'uglify', 'cssmin'].forEach(function(task) {
var config = grunt.config(task); var config = grunt.config(task);
@ -261,7 +277,7 @@ module.exports = function(grunt) {
grunt.registerTask('dev', [ grunt.registerTask('dev', [
'clean', 'clean',
//'jshint', 'jshint',
'views', 'views',
'sass', 'sass',
'concurrent:dev' 'concurrent:dev'
@ -271,7 +287,7 @@ module.exports = function(grunt) {
'clean', 'clean',
'jshint', 'jshint',
'views', 'views',
'test', //'test',
'sass', 'sass',
'useminPrepare', 'useminPrepare',
'clean-paths', 'clean-paths',
@ -283,7 +299,8 @@ module.exports = function(grunt) {
'usemin', 'usemin',
'copy:dist-static', 'copy:dist-static',
'clean:dist-static', 'clean:dist-static',
'copy:images' 'copy:images',
'copy:coreos-web'
]); ]);
grunt.registerTask('default', ['build']); grunt.registerTask('default', ['build']);

View File

@ -7,7 +7,7 @@
<title co-title co-title-suffix=" · etcd">etcd</title> <title co-title co-title-suffix=" · etcd">etcd</title>
<meta name="description" content=""> <meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- build:css /cp/static/main.css --> <!-- build:css /mod/dashboard/static/main.css -->
<link rel="stylesheet" href="/mod/dashboard/static/coreos-web/coreos.css"> <link rel="stylesheet" href="/mod/dashboard/static/coreos-web/coreos.css">
<link rel="stylesheet" href="/mod/dashboard/static/compiled/main.css"> <link rel="stylesheet" href="/mod/dashboard/static/compiled/main.css">
<!-- endbuild --> <!-- endbuild -->
@ -32,7 +32,7 @@
<co-toast></co-toast> <co-toast></co-toast>
<!-- build:js /cp/static/deps.js --> <!-- build:js /mod/dashboard/static/deps.js -->
<script src="/mod/dashboard/static/bower_components/jquery/dist/jquery.js"></script> <script src="/mod/dashboard/static/bower_components/jquery/dist/jquery.js"></script>
<script src="/mod/dashboard/static/bower_components/angular/angular.js"></script> <script src="/mod/dashboard/static/bower_components/angular/angular.js"></script>
<script src="/mod/dashboard/static/bower_components/angular-route/angular-route.js"></script> <script src="/mod/dashboard/static/bower_components/angular-route/angular-route.js"></script>
@ -42,11 +42,11 @@
<script src="/mod/dashboard/static/bower_components/underscore/underscore.js"></script> <script src="/mod/dashboard/static/bower_components/underscore/underscore.js"></script>
<script src="/mod/dashboard/static/bower_components/underscore.string/lib/underscore.string.js"></script> <script src="/mod/dashboard/static/bower_components/underscore.string/lib/underscore.string.js"></script>
<script src="/mod/dashboard/static/bower_components/d3/d3.js"></script> <script src="/mod/dashboard/static/bower_components/d3/d3.js"></script>
<script src="/mod/dashboard/static/coreos-web/coreos.js"></script> <script src="/mod/dashboard/static/coreos-web/coreos.min.js"></script>
<script src="/mod/dashboard/static/vega.js"></script> <script src="/mod/dashboard/static/vega.js"></script>
<!-- endbuild --> <!-- endbuild -->
<!-- build:js /cp/static/app.js --> <!-- build:js /mod/dashboard/static/app.js -->
<script src="/mod/dashboard/static/compiled/views.js"></script> <script src="/mod/dashboard/static/compiled/views.js"></script>
<script src="/mod/dashboard/static/etcd-dashboard.js"></script> <script src="/mod/dashboard/static/etcd-dashboard.js"></script>
<script src="/mod/dashboard/static/module/etcd-api.js"></script> <script src="/mod/dashboard/static/module/etcd-api.js"></script>