forked from ging/fiware-cloud-portal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
115 lines (108 loc) · 2.75 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
module.exports = function(grunt) {
'use strict';
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jshint: {
src: ['js/**/*.js'],
options: {
browser: true,
curly: false,
eqeqeq: false,
newcap: false,
undef: false,
eqnull: true,
node: false
},
globals: {
exports: true,
Ext: true,
console: true,
alert: true,
prompt: true
}
},
uglify: {
options: {
banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n',
compress: true,
mangle: true
},
libs: {
src: ['js/os-utils.js'],
dest: 'dist/libs.js'
},
models: {
src: ['js/models/**/*.js'],
dest: 'dist/models.js'
},
views: {
src: ['js/views/**/*.js'],
dest: 'dist/views.js'
},
routes: {
src: ['js/routes/**/*.js'],
dest: 'dist/routes.js'
}
},
concat: {
templates: {
src: ['templates/**/*.html'],
dest: 'dist/templates.html'
},
libs: {
src: ['js/os-utils.js'],
dest: 'dist/libs.js'
},
models: {
src: ['js/models/**/*.js'],
dest: 'dist/models.js'
},
views: {
src: ['js/views/**/*.js'],
dest: 'dist/views.js'
},
routes: {
src: ['js/routes/**/*.js'],
dest: 'dist/routes.js'
},
disttest: {
src: ['index.temp.head.test.html', 'index.temp.foot.html'],
dest: 'dist/index.test.html'
}
},
copy: {
main: {
files: [
{src: ['lib/**/*'], dest: 'dist/'},
{src: ['locales/**/*'], dest: 'dist/'},
{src: ['fonts/**/*'], dest: 'dist/'},
{src: ['css/**/*.css'], dest: 'dist/'},
{src: ['css/fonts/**/*'], dest: 'dist/'},
{src: ['ico/**/*'], dest: 'dist/'},
{src: ['images/**/*'], dest: 'dist/'}
]
}
},
sass: {
dist: {
options: {
style: 'compressed'
},
files: {
'css/all.css': ['css/src/all.scss']
}
}
},
clean: ['dist/']
});
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-sass');
// Default task.
grunt.registerTask('default', ['jshint', 'uglify', 'concat:templates', 'concat:disttest', 'sass', 'copy']);
grunt.registerTask('debug', ['jshint', 'concat', 'sass', 'copy']);
};