-
Notifications
You must be signed in to change notification settings - Fork 0
/
GruntFile.js
58 lines (56 loc) · 1.94 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
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
banner:'/*!\n * Copyright (c) Christopher Keefer, <%= grunt.template.today("yyyy") %>.\n' +
' * <%= pkg.name %>: V<%= pkg.version %>.\n' +
' * This file is generated by grunt - do not edit directly.\n' +
' * Alter source files as needed, then run `grunt` in project directory.\n' +
' * Compiled: <%= grunt.template.today("yyyy-mm-dd") %> \n */\n\n',
concat:{
options:{
stripBanners:{
block:true,
line:true
},
process:false,
separator:';\n' // Ensures an ending semi-colon after each file we concatenate
},
behold:{
src:[
'src/Behold.js'
],
dest:'dist/Behold-<%= pkg.version %>.js'
}
},
uglify:{
options:{
banner:'<%= banner %>',
report:'min'
},
behold:{
options:{
sourceMappingURL:'Behold.min.map',
sourceMapPrefix:2,
sourceMap:'dist/Behold.min.map'
},
src:'dist/Behold-<%= pkg.version %>.js',
dest:'dist/Behold-<%= pkg.version %>.min.js'
}
},
doxx: {
all: {
src:'src',
ignore:'node_modules,docs',
target:'docs'
}
}
});
// Load plugins for each task
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-doxx');
// Tasks
grunt.registerTask('default', ['concat', 'uglify', 'doxx']);
grunt.registerTask('justCode', ['concat', 'uglify']);
grunt.registerTask('justDocs', ['doxx']);
};