Skip to content

Instantly share code, notes, and snippets.

@ppscvalentin
Created July 20, 2016 09:18
Show Gist options
  • Save ppscvalentin/9a98569b0c84d78bbfe248bd592baf3f to your computer and use it in GitHub Desktop.
Save ppscvalentin/9a98569b0c84d78bbfe248bd592baf3f to your computer and use it in GitHub Desktop.
Basic Grunt setup
module.exports = function(grunt) {
require('jit-grunt')(grunt);
grunt.initConfig({
path: {
'static': 'static',
'src': 'src',
'node': 'node_modules'
},
less: {
options: {
sourceMap: false
},
development: {
options: {
sourceMap: true,
sourceMapFileInline: true
},
files: {
'<%= path.static %>/css/main.css': '<%= path.src %>/less/main.less'
}
},
production: {
files: {
'<%= path.static %>/css/main.css': '<%= path.src %>/less/main.less'
}
}
},
concat: {
js: {
src: [
'<%= path.src %>/js/some.js',
'<%= path.src %>/js/other.js'
],
dest: '<%= path.static %>/js/main.js'
}
},
watch: {
options: {
nospawn: true
},
less: {
files: ['<%= path.src %>/less/**/*.less'],
tasks: ['less:development']
}
}
});
grunt.registerTask('development', [
'less:development',
'concat:js'
]);
grunt.registerTask('production', [
'less:production',
'concat:js'
]);
grunt.registerTask('default', [
'development',
'watch'
]);
};
{
"name": "Project name",
"version": "0.0.1",
"description": "Project description",
"author": {
"name": "Eau de Web",
"email": "office@eaudeweb.ro",
"url": "http://www.eaudeweb.ro/"
},
"dependencies": {
"grunt": "^1.0.1",
"grunt-contrib-concat": "~0.5.1",
"grunt-contrib-less": "^1.0.1",
"grunt-contrib-watch": "^0.6.1",
"jit-grunt": "^0.9.1"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment