blob: ecf93d9637b7df47f12e801da0dac10d0d5a4d90 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2015 Eclipse Foundation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://eclipse.org/legal/epl-v10.html
*
* Contributors:
* Eric Poirier (Eclipse Foundation) - Initial implementation
*******************************************************************************/
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
project: {
src: 'assets/src',
css: [
'<%= project.src %>/scss/style.scss'
],
js: [
'<%= project.src %>/j/*.js'
]
},
less: {
development: {
options: {
compress: true,
// minifying the result
},
files: {
// compiling styles.less into styles.css
'./public/stylesheets/styles.min.css': './src/stylesheets/styles.less'
}
}
},
uglify: {
options: {
mangle: false
// Use if you want the names of your functions and variables
// unchanged.
},
js_files: {
files: {
'./public/javascript/scripts.min.js': './src/javascript/scripts.js',
}
},
},
watch: {
js_files: {
files: [
'./src/javascript/scripts.js'],
tasks: ['uglify:js_files']
},
less: {
files: ['./src/stylesheets/*.less', './src/stylesheets/**/*.less'],
tasks: ['less'],
options: {
livereload: true
// reloads the browser
}
},
}
});
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-uglify');
// Default task(s).
grunt.registerTask('default', ['watch']);
};