-
Notifications
You must be signed in to change notification settings - Fork 6
/
Gruntfile.js
100 lines (85 loc) · 2.21 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
SOURCE_FILES=[
'js/kt/spans.js',
'js/kt/util.js',
'js/kt/colors.js',
'js/kt/label.js',
'js/kt/karyotype.js',
'js/kt/datatrack.js',
'js/kt/main.js',
];
module.exports = function(grunt){
"use strict";
var pkg = grunt.file.readJSON('package.json');
var BANNER = '/*! KaryotypeJS - SVG based karyotype rendering. <%= pkg.name %> <%= pkg.version %> <%= grunt.template.today("yyy-mm-dd") %> */\n';
//var END_SNIPPET='return kt; }));';
//
//var START_SNIPPET=BANNER+"\n\
//(function (root, factory) {\n\
// if (typeof define === 'function' && define.amd) {\n\
// define([], factory);\n\
// } else {\n\
// var kt = factory();\n\
// root.kt = kt;\n\
// }\n\
//}(this, function () {\n\
// // modules will be inlined here\n\
//";
grunt.initConfig({
pkg: pkg,
jshint : {
options: {
multistr :true,
curly : true,
eqeqeq : true,
forin : true,
maxlen: 100,
/*freeze : true, */
immed : true,
latedef : true,
undef : true,
browser : true,
devel : true,
predef : [ 'define' ],
unused : true
},
all: SOURCE_FILES
},
requirejs: {
compile: {
options: {
name:'karyotype',
optimize: 'none',
baseUrl: "js",
mainConfigFile: "config.js",
out: "build/<%= pkg.name %>.dbg.js",
include:['vendor/require.js']
}
}
},
removelogging : {
dist : {
src : 'build/<%= pkg.name %>.dbg.js',
dest : 'build/<%= pkg.name %>.rel.js'
}
},
uglify: {
options : {
banner: BANNER
},
build : {
src: 'build/<%= pkg.name %>.rel.js',
dest: 'build/<%= pkg.name %>.min.js'
}
}
});
// Load the plugin that provides the "uglify" task.
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-remove-logging');
grunt.loadNpmTasks('grunt-contrib-requirejs');
// Default task(s).
grunt.registerTask('default', [
'jshint', 'requirejs', 'removelogging', 'uglify'
]);
};