forked from coryasilva/Leaflet.ExtraMarkers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
87 lines (59 loc) · 2.55 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
module.exports = function(grunt) {
/*****************************************************
____ __
/\ _`\ /\ \__
\ \ \L\_\ _ __ __ __ ___\ \ ,_\
\ \ \L_L /\`'__\/\ \/\ \ /' _ `\ \ \/
\ \ \/, \ \ \/ \ \ \_\ \/\ \/\ \ \ \_
\ \____/\ \_\ \ \____/\ \_\ \_\ \__\
\/___/ \/_/ \/___/ \/_/\/_/\/__/
*****************************************************/
'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');
});
};