-
Notifications
You must be signed in to change notification settings - Fork 1
/
Gruntfile.js
122 lines (119 loc) · 4.31 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
var path = require('path');
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
concat: {
options: {
separator: ';\n'
},
basic: {
//use core because it is the "base", but needs compiled templates to work
src: ['src/heatmap-table-core.js',
'templates/build/heatmap-compiled-templates.js'],
dest: 'dist/heatmap-table.js'
},
css: {
src: ['src/heatmap-table.css',
'bower_components/bootstrap/dist/css/bootstrap.min.css',
'bower_components/jquery-typeahead/dist/jquery.typeahead.min.css'],
dest: 'dist/heatmap-table.css'
},
vendor: {
src: ['bower_components/handlebars/handlebars.js',
'bower_components/jquery/dist/jquery.min.js',
'bower_components/jquery-typeahead/dist/jquery.typeahead.min.js',
'bower_components/bootstrap/dist/js/bootstrap.min.js'],
dest: 'dist/heatmap-table-vendor.js'
},
bundle: {
//the keyword vendor is used for external dependencies
src: ['dist/heatmap-table-vendor.js',
'dist/heatmap-table.js'],
//the keyword bundle is for the full package source + dependencies
dest: 'dist/heatmap-table-bundle.js'
},
nextprot: {
src: ['dist/heatmap-table-bundle.js',
'vendor/js/nextprot.js',
'src/convert-nextprot-to-heatmap.js'],
dest: 'dist/hierarchic-heatmap-table.nextprot.js'
}
},
connect: {
server: {
options: {
port: 5000,
livereload: true,
base: '.'
}
}
},
watch: {
all: {
options: {
livereload: true
},
files: ['src/*.js', 'templates/src/*.tmpl', 'src/*.css', 'doc/*.pug'],
tasks: ['handlebars:compile', 'concat', "pug:compile"]
},
handlebars: {
files: 'templates/src/*.tmpl',
tasks: ['handlebars:compile']
},
pug: {
files: "doc/pug/*.pug",
tasks: ['pug:compile']
}
},
handlebars: {
compile: {
src: 'templates/src/*.tmpl',
dest: 'templates/build/heatmap-compiled-templates.js',
options: {
namespace: "HBtemplates"
}
}
},
pug: {
compile: {
options: {
data: {}
},
files: [{
src: "**/*.pug",
dest: "doc",
ext: ".html",
cwd: "doc",
expand: true
}]
}
},
bump: {
options: {
files: ['package.json'],
updateConfigs: [],
commit: true,
commitMessage: 'Release v%VERSION%',
commitFiles: ['package.json'],
createTag: true,
tagName: 'v%VERSION%',
tagMessage: 'Version %VERSION%',
push: true,
pushTo: 'https://github.com/calipho-sib/hierarchic-heatmap-table-component.git',
gitDescribeOptions: '--tags --always --abbrev=1 --dirty=-d',
globalReplace: false,
prereleaseName: false,
regExp: false
}
}
});
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-contrib-handlebars');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-pug');
grunt.loadNpmTasks('grunt-bump');
grunt.registerTask('default', ['connect:server', 'pug', 'concat', 'watch:all']);
grunt.registerTask('prod', ['concat']);
grunt.registerTask('serve', ['connect:server','watch']);
};