This repository has been archived by the owner on Sep 8, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
121 lines (115 loc) · 3.44 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
/*
* The contents of this file are subject to the license and copyright
* detailed in the LICENSE and NOTICE files at the root of the source
* tree and available online at
*
* http://www.dspace.org/license/
*/
// Generated on 2013-11-09 using generator-webapp 0.4.3
'use strict';
module.exports = function (grunt) {
// show elapsed time at the end
require('time-grunt')(grunt);
// load all grunt tasks
require('load-grunt-tasks')(grunt);
grunt.initConfig({
copy: {
classic_mirage_color_scheme: {
files: [
{
src: ['styles/classic_mirage_color_scheme/_main.scss'],
dest: 'styles/main.scss'
}
]
},
bootstrap_color_scheme: {
files: [
{
src: ['styles/bootstrap_color_scheme/_main.scss'],
dest: 'styles/main.scss'
}
]
},
scriptsxml: {
files: [
{
src: ['scripts.xml'],
dest: 'scripts-dist.xml'
}
]
}
},
compass: {
prod: {
options: {
config: 'config-prod.rb'
}
},
dev: {
options: {
config: 'config-dev.rb'
}
}
},
coffee: {
glob_to_multiple: {
expand: true,
flatten: true,
cwd: 'scripts',
src: ['*.coffee'],
dest: 'scripts',
ext: '.js'
}
},
handlebars: {
compile: {
options: {
namespace: "DSpace.templates",
processName: function(filePath) {
return filePath.replace(/^templates\//, '').replace(/\.handlebars$/, '').replace(/\.hbs$/, '');
}
},
files: {
"scripts/templates.js": ["templates/*.handlebars", "templates/*.hbs"]
}
}
},
useminPrepare:{
src: ['scripts-dist.xml'],
options: {
// fool usemin in to putting theme.js straight into the scripts
// folder, and not in a separate dist folder. And no, you can't
// just use an empty string, I tried ;)
dest: 'dist/../'
}
} ,
usemin: {
html:'scripts-dist.xml'
}
});
grunt.registerTask('classic_mirage_color_scheme', [
'copy:classic_mirage_color_scheme'
]);
grunt.registerTask('bootstrap_color_scheme', [
'copy:bootstrap_color_scheme'
]);
grunt.registerTask('shared-steps', [
'copy:scriptsxml', 'coffee', 'handlebars', 'useminPrepare','concat'
]);
grunt.registerTask('no-compass-prod', [
'shared-steps','uglify','usemin'
]);
grunt.registerTask('no-compass-dev', [
'shared-steps','uglify:generated'
]);
grunt.registerTask('prod', [
'compass:prod', 'no-compass-prod'
]);
grunt.registerTask('dev', [
'compass:dev', 'no-compass-dev'
]);
grunt.registerTask('default', [
'classic_mirage_color_scheme',
'prod'
]);
};