-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathGruntfile.js
More file actions
111 lines (104 loc) · 3.59 KB
/
Gruntfile.js
File metadata and controls
111 lines (104 loc) · 3.59 KB
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
/*global module:false*/
'use srtict';
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
meta: {
banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - '+
'<%= grunt.template.today("yyyy-mm-dd") %>' + '\n' +
'<%= pkg.homepage ? "* " + pkg.homepage : "" %>' + '\n' +
' * Copyright (c) <%= grunt.template.today("yyyy") %> ' +
' <%= pkg.author %>;' + '\n' +
' * License: (<%= pkg.license %>)' + '\n' +
' */\n\n'
},
update_json: {
bower: {
src: 'package.json',
dest: 'bower.json',
fields: [
'name',
'version',
'authors',
'description',
'keywords',
'license'
]
}
},
clean: {
build: ['dist/*']
},
jshint: {
options: {
reporter: require('jshint-stylish'),
jshintrc: true
},
files: [
'src/**/*.js'
]
},
requirejs: {
options:{
paths: {
cofs: 'src',
buffer: 'bower_components/buffer/buffer',
async: 'bower_components/async/lib/async',
eventemitter2: 'bower_components/eventemitter2/lib/eventemitter2'
}
},
nodeps: {
options: {
name: 'node_modules/almond/almond',
include: ['cofs/fs'],
out: 'dist/<%= pkg.name %>.nodeps.js',
optimize: 'uglify2',
wrap: {
startFile: 'extra/start.nodeps.js',
endFile: 'extra/end.nodeps.js'
}
}
},
min: {
options: {
paths: {
cofs: 'src',
buffer: 'empty:',
async: 'empty:',
eventemitter2: 'empty:'
},
name: 'node_modules/almond/almond',
include: ['cofs/fs'],
out: 'dist/<%= pkg.name %>.min.js',
optimize: 'uglify2',
wrap: {
startFile: 'extra/start.min.js',
endFile: 'extra/end.min.js'
}
}
},
},
jsdoc: {
dist: {
src: [
'README.md',
'src/**/*.js'
],
options: {
destination: 'docs',
//template: "node_modules/grunt-jsdoc/node_modules/ink-docstrap/template",
//configure: "node_modules/grunt-jsdoc/node_modules/ink-docstrap/template/jsdoc.conf.json"
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-update-json');
grunt.loadNpmTasks('grunt-contrib-requirejs');
grunt.loadNpmTasks('grunt-jsdoc');
grunt.registerTask('build', ['clean', 'update_json', 'requirejs']);
grunt.registerTask('check', ['jshint']);
grunt.registerTask('default', ['jshint', 'update_json', 'build']);
};