AdminLTE/Gruntfile.js

53 lines
1.5 KiB
JavaScript
Raw Normal View History

2015-02-01 22:25:09 +01:00
'use strict';
module.exports = function (grunt) {
// load all grunt tasks
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-watch');
2015-02-02 17:52:30 +01:00
grunt.loadNpmTasks('grunt-contrib-uglify');
2015-02-01 22:25:09 +01:00
grunt.initConfig({
watch: {
// if any .less file changes in directory "build/less/" run the "less"-task.
2015-02-02 17:52:30 +01:00
files: ["build/less/*.less", "build/less/skins/*.less", "dist/js/app.min.js"],
tasks: ["less", "uglify"]
2015-02-01 22:25:09 +01:00
},
// "less"-task configuration
2015-02-02 17:52:30 +01:00
//this task will compile all less files upon saving to create both AdminLTE.css and AdminLTE.min.css
2015-02-01 22:25:09 +01:00
less: {
//Development not compressed
development: {
options: {
2015-02-02 17:52:30 +01:00
//Wether to compress or not
2015-02-01 22:25:09 +01:00
compress: false
},
files: {
// compilation.css : source.less
"dist/css/AdminLTE.css": "build/less/AdminLTE.less"
}
},
//production compresses version
production: {
options: {
2015-02-02 17:52:30 +01:00
//Wether to compress or not
2015-02-01 22:25:09 +01:00
compress: true
},
files: {
// compilation.css : source.less
"dist/css/AdminLTE.min.css": "build/less/AdminLTE.less"
}
}
2015-02-02 17:52:30 +01:00
},
//Uglify task info
uglify: {
options: {
mangle: true
},
my_target: {
files: {
'dist/js/app.min.js': ['dist/js/app.js']
}
}
2015-02-01 22:25:09 +01:00
}
});
// the default task (running "grunt" in console) is "watch"
grunt.registerTask('default', ['watch']);
};