2013-03-23 00:39:08 +01:00
|
|
|
module.exports = function(grunt) {
|
|
|
|
|
|
|
|
// Project configuration.
|
|
|
|
grunt.initConfig({
|
|
|
|
pkg: grunt.file.readJSON('package.json'),
|
|
|
|
uglify: {
|
2013-03-24 00:24:27 +01:00
|
|
|
files: {
|
|
|
|
expand: true, // Enable dynamic expansion.
|
|
|
|
cwd: 'NzbDrone.Backbone/', // Src matches are relative to this path.
|
|
|
|
src: ['**/*.js'], // Actual pattern(s) to match.
|
|
|
|
dest: 'build/', // Destination path prefix.
|
2013-03-24 01:14:55 +01:00
|
|
|
ext: '.min.js'
|
2013-03-24 00:24:27 +01:00
|
|
|
}
|
|
|
|
},
|
|
|
|
less:{
|
|
|
|
bootstrap:{
|
2013-03-24 01:14:55 +01:00
|
|
|
src: ["NzbDrone.Backbone/Content/Bootstrap/bootstrap.less"],
|
|
|
|
dest: "NzbDrone.Backbone/Content/bootstrap.css"
|
2013-03-23 00:39:08 +01:00
|
|
|
}
|
|
|
|
},
|
2013-03-24 00:24:27 +01:00
|
|
|
|
2013-03-23 00:39:08 +01:00
|
|
|
handlebars: {
|
|
|
|
options: {
|
2013-03-24 00:24:27 +01:00
|
|
|
namespace: "NzbDrone.Templates",
|
|
|
|
wrapped: false,
|
|
|
|
processName: function(fileName){
|
|
|
|
return fileName
|
|
|
|
.replace('NzbDrone.Backbone/','')
|
|
|
|
.replace('.html','');
|
|
|
|
}
|
2013-03-23 00:39:08 +01:00
|
|
|
},
|
|
|
|
files: {
|
2013-03-24 00:24:27 +01:00
|
|
|
src: ['NzbDrone.Backbone/**/*emplate.html'],
|
|
|
|
dest: 'NzbDrone.Backbone/templates.js'
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
watch:{
|
|
|
|
bootstrap:{
|
2013-03-24 01:14:55 +01:00
|
|
|
files: '<%= less.bootstrap.src %>',
|
2013-03-24 00:24:27 +01:00
|
|
|
tasks: ['less:bootstrap']
|
|
|
|
},
|
|
|
|
handlebars:{
|
|
|
|
files: '<%= handlebars.files.src %>',
|
|
|
|
tasks: ['handlebars']
|
2013-03-23 00:39:08 +01:00
|
|
|
}
|
2013-03-24 00:24:27 +01:00
|
|
|
|
|
|
|
}
|
|
|
|
});
|
2013-03-23 00:39:08 +01:00
|
|
|
|
|
|
|
// Load the plugin that provides the "uglify" task.
|
|
|
|
grunt.loadNpmTasks('grunt-contrib-uglify');
|
|
|
|
grunt.loadNpmTasks('grunt-contrib-handlebars');
|
2013-03-24 00:24:27 +01:00
|
|
|
grunt.loadNpmTasks('grunt-contrib-less');
|
|
|
|
grunt.loadNpmTasks('grunt-contrib-watch');
|
|
|
|
grunt.loadNpmTasks('grunt-contrib-concat');
|
2013-03-23 00:39:08 +01:00
|
|
|
|
|
|
|
// Default task(s).
|
2013-03-24 01:14:55 +01:00
|
|
|
grunt.registerTask('default', ['less:bootstrap','handlebars', 'watch']);
|
2013-03-23 00:39:08 +01:00
|
|
|
|
|
|
|
};
|