mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-10-24 02:04:04 +08:00
Add grunt watcher on the .less files
This commit is contained in:
@@ -75,15 +75,30 @@ module.exports = function( grunt ){
|
||||
]
|
||||
});
|
||||
|
||||
|
||||
// -------------------------------------------------------------------------- watch & rebuild less files
|
||||
// use 'grunt watch-style' (from a new tab in your terminal) to have grunt re-copy changed files automatically
|
||||
grunt.config( 'watch', {
|
||||
watch: {
|
||||
// watch for changes in the src dir
|
||||
files: [ lessPath + '/**' ],
|
||||
tasks: ['check-modules', 'sprite', 'less-site-config', 'less', 'clean'],
|
||||
options: {
|
||||
spawn: false
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
grunt.loadNpmTasks( 'grunt-contrib-less' );
|
||||
grunt.loadNpmTasks( 'grunt-spritesmith' );
|
||||
grunt.loadNpmTasks( 'grunt-contrib-clean' );
|
||||
|
||||
grunt.loadNpmTasks( 'grunt-contrib-watch' );
|
||||
|
||||
// Write theme variable for less
|
||||
grunt.registerTask( 'less-site-config', 'Write site configuration for less', function() {
|
||||
grunt.file.write( fmt( '%s/tmp-site-config.less', lessPath ), fmt( "@theme-name: %s;", theme ) );
|
||||
});
|
||||
|
||||
grunt.registerTask( 'watch-style', [ 'watch' ] );
|
||||
grunt.registerTask( 'style', [ 'check-modules', 'sprite', 'less-site-config', 'less', 'clean' ] );
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user