-
Notifications
You must be signed in to change notification settings - Fork 29
/
Gruntfile.js
84 lines (71 loc) · 1.52 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
'use strict';
module.exports = function(grunt) {
//Configure Grunt
grunt.initConfig({
//Point to the package file
pkg: grunt.file.readJSON('package.json'),
//Configure JSHint with files to exclude and options
jshint: {
files: [
'**/*.js',
'!Gruntfile.js',
'!lib/libraries/*',
'!node_modules/**/*',
'!dist/**/*'
],
options: {
jshintrc: '.jshintrc'
}
},
//Configure Browserify build, no debug map and don't keep alive
browserify: {
default:{
options:{
debug: false,
keepalive: false
},
files:{
'dist/dungeongeneration.js': [ 'lib/init.js' ]
}
}
},
//Configure Watchify build used while developing, debug map and constant file watch
watchify: {
options:{
debug: true,
keepalive: true
},
default: {
src: './lib/init.js',
dest: './dist/dungeongeneration.js'
}
},
//Configure Uglify that is executed when creating a new build
uglify: {
dist: {
files: {
'dist/dungeongeneration.min.js': 'dist/dungeongeneration.js'
}
}
}
});
//Load plug-ins
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-browserify');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-watchify');
//Define 'grunt debug' task
grunt.registerTask('debug', [
'jshint',
]);
//Define 'grunt build' task
grunt.registerTask('build', [
'browserify',
'uglify'
]);
//Define 'grunt dev' task
grunt.registerTask('dev', [
'watchify',
]);
};