forked from coryasilva/Leaflet.ExtraMarkers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
64 lines (50 loc) · 2.13 KB
/
Gruntfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
module.exports = function(grunt) {
'use strict';
// require it at the top and pass in the grunt instance
require('time-grunt')(grunt);
/*****************************************************
Grunt Init Config:
load each task config into grunt via require
*****************************************************/
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
// Project Config
project: require('./build/grunt-config/project'), // Contains paths and banner
less: require('./build/grunt-config/less'), // Config to compile and autoprefix less files
uglify: require('./build/grunt-config/uglify'),
jshint: require('./build/grunt-config/jshint'), // Lint Javascript
});
/*****************************************************
Dev Tasks - Compile and check files withing the /src/assets/ directory
*****************************************************/
// Default grunt task compiles & checks dev files
grunt.registerTask('default', [], function(){
grunt.loadNpmTasks('grunt-contrib-less');
grunt.task.run('less:dev','js-dev');
});
// Javascript Dev Build - Checks for Errors in Javascript
grunt.registerTask('js-dev', [], function(){
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.task.run('jshint:all', 'uglify:dev');
});
/*****************************************************
Dist Tasks
*****************************************************/
// 'grunt build' global build command for both less and js files
grunt.registerTask('build', 'Compiles all files for live environment', function() {
grunt.loadNpmTasks('grunt-contrib-less');
grunt.task.run('less:build', 'js-build');
});
// 'grunt js-build' compiles only javascript
grunt.registerTask('js-build', [], function(){
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.task.run('jshint:all', 'uglify:build');
});
// 'grunt less-build' compiles only less
grunt.registerTask('less-build', [], function(){
grunt.loadNpmTasks('grunt-contrib-less');
grunt.task.run('less:build');
});
};