-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgruntfile.js
More file actions
145 lines (131 loc) · 3.89 KB
/
gruntfile.js
File metadata and controls
145 lines (131 loc) · 3.89 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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-watch');
// Default task.
grunt.registerTask('default', ['jshint','build']);
grunt.registerTask('dev', ['default', 'connect', 'watch']);
grunt.registerTask('build', ['clean','concat','copy']);
grunt.registerTask('timestamp', function() {
grunt.log.subhead(Date());
});
grunt.initConfig({
distdir: 'target',
pkg: grunt.file.readJSON('package.json'),
banner:
'/*! <%= pkg.title || pkg.name %>-<%= pkg.version %> (<%= grunt.template.today("yyyy-mm-dd") %>)\n' +
'<%= pkg.homepage ? " * " + pkg.homepage + "\\n" : "" %>' +
' * Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author %>;\n' +
' * Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %>\n */\n',
src: {
js: ['src/**/*.js'],
html: ['src/index.html'],
css: ['src/css/*.css'],
},
clean: ['<%= distdir %>/*'],
copy: {
assets: {
files: [ {dest: '<%= distdir %>',
src : '**',
expand: true,
cwd: 'src/assets/'}]
},
partials: {
files: [ {dest: '<%= distdir %>/partials/',
src: '**/*.html',
expand: true,
cwd: 'src/partials'} ]
},
vendor: {
files: [ {dest: '<%= distdir %>/dist/ace',
src: [
'ace-builds-master/src-noconflict/*'
],
expand: true,
flatten: true,
cwd: 'vendor/'},
{dest: '<%= distdir %>/fonts',
src : 'bootstrap-3.1.1/dist/fonts/*',
expand: true,
flatten: true,
cwd: 'vendor/'}
],
}
},
concat:{
dist:{
options: { banner: "<%= banner %>" },
src: ['<%= src.js %>'],
dest:'<%= distdir %>/dist/<%= pkg.name %>.js'
},
index: {
src: ['src/index.html'],
dest: '<%= distdir %>/index.html',
options: { process: true }
},
js: {
src: ['vendor/jquery-1.11.0.js',
'vendor/jquery-ui-1.8.15.js',
'vendor/multiselect/bootstrap-multiselect.js',
'node_modules/underscore/underscore.js',
'node_modules/json3/lib/json3.js',
'vendor/angular-1.2.14/angular.js',
'vendor/angular-1.2.14/angular-route.js',
'vendor/angular-1.2.14/angular-resource.js',
'node_modules/ng-storage/ngStorage.min.js',
'node_modules/tm-cloud-client-angularjs/src/tm.cloud.client.js',
'vendor/tagsinput/bootstrap-tagsinput.js',
'vendor/tagsinput/bootstrap-tagsinput-angular.js',
'node_modules/rickshaw/node_modules/d3/d3.js',
'node_modules/rickshaw/rickshaw.js',
'vendor/spin.js',
'vendor/angular-spinner.js',
'vendor/crypto-js-3.1.2/rollups/*.js',
'vendor/crypto-js-3.1.2/components/*.js' ],
dest: '<%= distdir %>/dist/vendor.js'
},
css: {
src: ["vendor/bootstrap-3.1.1/dist/css/bootstrap.css",
"vendor/{multiselect,tagsinput}/*.css",
"vendor/{multiselect,tagsinput}/*.css",
"node_modules/rickshaw/rickshaw.css",
"<%= src.css %>",
],
dest: '<%= distdir %>/dist/style.css',
}
},
watch:{
all: {
files: ['<%= src.js %>', '<%= src.html %>', '<%= src.css %>', 'src/partials/**/*.html'],
tasks: ['default','timestamp']
},
},
jshint:{
files: ['gruntFile.js', '<%= src.js %>'],
options:{
curly: true,
eqeqeq: true,
immed: true,
latedef: true,
noarg: true,
sub: true,
boss: true,
eqnull: true,
es5: true,
globals: {"angular": false}
}
},
connect: {
server: {
options: {
port: 8000,
base: ".",
hostname: "0.0.0.0"
}
}
},
});
};