-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathGruntfile.js
146 lines (141 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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
'use strict';
module.exports = function (grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
project: {
sass_dir: ['build/sass'],
http_path: ['/'],
http_asset_path: ['<%= project.http_path %>'],
http_css_path: ['<%= project.http_asset_path %>/css'],
http_js_path: ['<%= project.http_asset_path %>/js'],
http_img_path: ['<%= project.http_asset_path %>/img'],
http_gen_img_path: ['<%= project.http_img_path %>'],
http_font_path: ['<%= project.http_asset_path %>/fonts'],
web_dir: ['public'],
css_dir: ['<%= project.web_dir %>/<%= project.http_css_path %>'],
js_dir: ['<%= project.web_dir %>/<%= project.http_js_path %>'],
img_dir: ['<%= project.web_dir %>/<%= project.http_img_path %>'],
gen_img_dir: ['<%= project.img_dir %>'],
font_dir: ['<%= project.web_dir %>/<%= project.http_font_path %>'],
styleguide_css_dir: ['app/views/docs/styleguide/css']
},
sass: {
options: {
includePaths: [
'./bower_components',
'./build/sass'
]
},
development: {
options: {
style: 'expanded'
},
files: {
'<%= project.css_dir %>/brie.css': '<%= project.sass_dir %>/brie.scss',
'<%= project.styleguide_css_dir %>/styleguide.css': '<%= project.sass_dir %>/styleguide.scss'
}
},
production: {
options: {
style: 'compressed',
sourceMap: false
},
files: {
'<%= project.css_dir %>/brie.css': '<%= project.sass_dir %>/brie.scss',
'<%= project.styleguide_css_dir %>/styleguide.css': '<%= project.sass_dir %>/styleguide.scss'
}
}
},
copy: {
js: {
src: [
'bower_components/jquery/dist/*',
'bower_components/bootstrap-sass-official/assets/fonts/javascript/*'
],
dest: 'public/js/',
expand: true
},
css: {
src: [],
dest: '',
expand: true
},
fonts: {
src: [
'bower_components/bootstrap-sass-official/assets/fonts/*'
],
dest: 'public/fonts/',
expand: true
},
fontawesome: {
files: [
// Fonts
{
expand: true,
filter: 'isFile',
flatten: true,
cwd: 'bower_components/',
src: ['components-font-awesome/fonts/**'],
dest: 'public/fonts'
}/*,
// CSS
{
expand: true,
filter: 'isFile',
flatten: true,
cwd: 'bower_components/',
src: ['components-font-awesome/css/**'],
dest: 'public/css'
}
*/
]
},
"bootstrap-tour": {
files: [
// CSS
{
expand: true,
filter: 'isFile',
flatten: true,
cwd: 'bower_components/',
src: ['bootstrap-tour/build/css/**'],
dest: 'public/css'
},
// JS
{
expand: true,
filter: 'isFile',
flatten: true,
cwd: 'bower_components/',
src: ['bootstrap-tour/build/js/**'],
dest: 'public/js'
}
]
},
"jasny-bootstrap": {
files: [
// JS
{
expand: true,
filter: 'isFile',
flatten: true,
cwd: 'bower_components/',
src: ['jasny-bootstrap/dist/js/**'],
dest: 'public/js'
}
]
}
},
watch: {
css: {
files: '<%= project.sass_dir %>/{,*/}*.{scss,sass}',
tasks: ['sass:development']
}
}
});
grunt.loadNpmTasks('grunt-sass');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.registerTask('default', ['watch']);
grunt.registerTask('build', ['sass:production', 'copy:fontawesome', 'copy:bootstrap-tour', 'copy:jasny-bootstrap']);
};