-
Notifications
You must be signed in to change notification settings - Fork 101
/
Copy pathgruntfile.js
70 lines (62 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
65
66
67
68
69
70
/* global module, require */
module.exports = function (grunt) {
'use strict';
var SRC_DIR = 'src/',
SRC_FILES = [
SRC_DIR + 'TextHighlighter.js',
SRC_DIR + 'jquery.textHighlighter.js'
],
TEST_DIR = 'test/',
SPEC_FILES = [
TEST_DIR + 'specs/basics.spec.js',
TEST_DIR + 'specs/highlighting.spec.js',
TEST_DIR + 'specs/flattening.spec.js',
TEST_DIR + 'specs/merging.spec.js',
TEST_DIR + 'specs/normalization.spec',
TEST_DIR + 'specs/removing.spec.js',
TEST_DIR + 'specs/serialization.spec.js',
TEST_DIR + 'specs/callbacks.spec.js',
TEST_DIR + 'specs/finding.spec.js'
],
BUILD_DIR = 'build/',
DOC_DIR = 'doc',
BUILD_TARGET = 'TextHighlighter.min.js';
grunt.initConfig({
_TARGET: BUILD_DIR + BUILD_TARGET,
closurecompiler: {
minify: {
files: {
"<%= _TARGET %>": SRC_FILES
},
options: {
"compilation_level": "SIMPLE_OPTIMIZATIONS",
"banner": '/*\n' + require('fs').readFileSync('LICENSE', { encoding: 'utf8' }) + '*/'
}
}
},
jsdoc : {
dist : {
src: SRC_FILES.concat('README.md'),
options: {
configure: 'jsdoc.conf.json',
destination: DOC_DIR,
private: false,
template : "node_modules/grunt-jsdoc/node_modules/ink-docstrap/template"
}
}
},
jshint: {
src: [ 'gruntfile.js', SRC_FILES, SPEC_FILES ],
options: {
jshintrc: true
}
},
clean: [ BUILD_DIR, DOC_DIR ]
});
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-closurecompiler');
grunt.loadNpmTasks('grunt-jsdoc');
grunt.registerTask('build', ['closurecompiler:minify']);
grunt.registerTask('default', ['build']);
};