Client build system: add 'grunt watch' command: automatically copies files from client/galaxy/scripts/ to static/scripts when they change in client/galaxy/scripts; add some missing files and pack scripts

This commit is contained in:
Carl Eberhard
2014-09-16 13:42:40 -04:00
parent 675ae1eee4
commit ecea8af0a9
6 changed files with 202 additions and 5 deletions
+13 -4
View File
@@ -2,8 +2,10 @@ module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
pkg: grunt.file.readJSON( 'package.json' ),
// default task
// use 'grunt copy' to copy the entire <galaxy>/client/galaxy/scripts dir into <galaxy>/static/scripts
copy: {
main: {
expand: true,
@@ -11,11 +13,18 @@ module.exports = function(grunt) {
src: '**',
dest: '../static/scripts/'
}
}
},
// use 'grunt watch' (from a new tab in your terminal) to have grunt re-copy changed files automatically
watch: {
// watch for changes in the src dir
files: [ 'galaxy/scripts/**' ],
tasks: [ 'default' ]
}
});
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks( 'grunt-contrib-watch' );
grunt.loadNpmTasks( 'grunt-contrib-copy');
grunt.registerTask('default', ['copy']);
grunt.registerTask( 'default', [ 'copy' ] );
};