Instantly share code, notes, and snippets.

Embed
What would you like to do?
module.exports = function (grunt) {
require('load-grunt-tasks')(grunt);
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
//begin vars
blog: {
assets: {
src: 'src/KGLLC.Blog/assets'
},
views: {
src: 'src/KGLLC.Blog/Views'
}
},
oakGrove: {
assets: {
src: 'src/KGLLC.OakGrove/assets'
},
views: {
src: 'src/KGLLC.OakGrove/Views'
}
},
umbraco: {
assets: {
dest: 'src/KGLLC.Umbraco/assets'
},
views: {
dest: 'src/KGLLC.Umbraco/Views'
}
},
//end vars
watch: {
options: {
spawn: false,
atBegin: true
},
blogLess: {
files: '<%= blog.assets.src %>/**/*.less',
tasks: [
'less:blog'
]
},
blogAssets: {
files: ['<%= blog.assets.src %>/**/*.*'],
tasks: ['copy:blogAssets']
},
blogViews: {
files: ['<%= blog.views.src %>/**/*.*'],
tasks: ['copy:blogViews']
},
oakGroveLess: {
files: '<%= oakGrove.assets.src %>/**/*.less',
tasks: [
'less:oakGrove'
]
},
oakGroveAssets: {
files: ['<%= oakGrove.assets.src %>/**/*.*'],
tasks: ['copy:oakGroveAssets']
},
oakGroveViews: {
files: ['<%= oakGrove.views.src %>/**/*.*'],
tasks: ['copy:oakGroveViews']
}
},
//register less
less: {
blog: {
options: {
paths: ['<%= blog.assets.src %>/blog/stylesheets/less/*.less']
},
files: {
'<%= blog.assets.src %>/blog/stylesheets/css/application.css': '<%= blog.assets.src %>/blog/stylesheets/less/application.less'
}
},
oakGrove: {
options: {
paths: ['<%= oakGrove.assets.src %>/oakGrove/less/*.less']
},
files: {
'<%= oakGrove.assets.src %>/oakGrove/css/custom.css': '<%= oakGrove.assets.src %>/oakGrove/less/custom.less'
}
}
},
//register copy
copy: {
blogAssets: {
cwd: '<%= blog.assets.src %>/',
src: ['**/*.*'],
dest: '<%= umbraco.assets.dest %>',
expand: true
},
blogViews: {
cwd: '<%= blog.views.src %>/',
src: ['**/*.*'],
dest: '<%= umbraco.views.dest %>',
expand: true
},
oakGroveAssets: {
cwd: '<%= oakGrove.assets.src %>/',
src: ['**/*.*'],
dest: '<%= umbraco.assets.dest %>',
expand: true
},
oakGroveViews: {
cwd: '<%= oakGrove.views.src %>/',
src: ['**/*.*'],
dest: '<%= umbraco.views.dest %>',
expand: true
}
}
});
grunt.registerTask('assets', ['less', 'copy:blogAssets', 'copy:blogViews', 'copy:oakGroveAssets', 'copy:oakGroveViews']);
grunt.registerTask('default', 'assets');
grunt.registerTask('just-less', ['less']);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment