-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
executable file
·151 lines (142 loc) · 4.95 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
147
148
149
150
151
module.exports = function(grunt) {
require('time-grunt')(grunt);
require('load-grunt-tasks')(grunt); // npm install --save-dev load-grunt-tasks
grunt.initConfig({
// Clean -------------------------------------------------------------------
clean: {
style: ['./styleguide/css', './styleguide/dist', './styleguide/styleguide']
},
// Copy --------------------------------------------------------------------
copy: {
styleguide: {
files: [
{ src: ['./styleguide/styleguide.md'], dest: './styleguide/css/styleguide.md'}
]
},
allStyles: {
files: [
{ src: ['./styleguide/css/rubik.css'], dest: './styleguide/styleguide/public/rubik.css'},
{ src: ['./styleguide/css/candidates.css'], dest: './styleguide/styleguide/public/candidates.css'},
{ src: ['./styleguide/css/companies.css'], dest: './styleguide/styleguide/public/companies.css'},
{ src: ['./styleguide/css/main.css'], dest: './styleguide/styleguide/public/main.css'}
]
},
copyFonts: {
files: [
{ src: ['./fonts/*'], dest: './styleguide/styleguide/'}
]
},
copyMedia: {
files: [
{ src: ['./styleguide/images/**'], dest: './styleguide/'}
]
},
copyJS: {
files: [
{ src: ['./styleguide/js/**'], dest: 'styleguide/'},
{ src: ['./js/**'], dest: 'styleguide/styleguide/'}
]
},
copyHTML: {
files: [
{ src: ['./html/**'], dest: 'styleguide/styleguide/'}
]
},
copyRubik: {
expand: true,
cwd: 'styleguide/styleguide/',
src: ['**'],
dest: '../rubik.public/'
}
},
// Sass --------------------------------------------------------------------
sass: {
development: {
options: {
style: 'expanded'
},
files: [
{ src: ['styleguide/rubik-styleguide.scss'], dest: 'styleguide/css/rubik.doc.css'},
{ src: ['styleguide/templates/infojobs/public/sass/main.scss'], dest: 'styleguide/css/main.doc.css'}
]
},
production: {
options: {
style: 'compressed'
},
files: [
{ src: ['styleguide/rubik-styleguide.scss'], dest: 'styleguide/css/rubik.css'},
{ src: ['styles/candidates.scss'], dest: 'styleguide/css/candidates.css'},
{ src: ['styles/companies.scss'], dest: 'styleguide/css/companies.css'},
{ src: ['styleguide/templates/infojobs/public/sass/main.scss'], dest: 'styleguide/css/main.css'}
]
}
},
// Include replace ---------------------------------------------------------
includereplace: {
dist: {
options: {},
files: [
{src: './styleguide/css/rubik.doc.css', dest: 'styleguide/dist/', expand: true, cwd: ''},
{src: './styleguide/css/main.doc.css', dest: 'styleguide/dist/', expand: true, cwd: ''},
{src: 'styleguide/templates/infojobs/index.html', dest: '', expand: true, cwd: ''}
]
}
},
// Text replace ------------------------------------------------------------
replace: {
casper: {
src: ['styleguide/styleguide/*.html'],
overwrite: true, // overwrite matched source files
replacements: [{
from: ' casper',
to: ''
},
{
from: 'casper ',
to: ''
},
{
from: 'class="casper"',
to: ''
},
{
from: '#disabled#',
to: ''
},
{
from: '#casper#',
to: ''
}]
}
},
less: {
development: {
options: {
paths: ["assets/css"]
},
files: {
"./styleguide/templates/infojobs/public/kss.css": "./styleguide/templates/infojobs/public/kss.less"
}
}
},
// Shell -------------------------------------------------------------------
shell: {
// Kss-node ------------------------------------------------------------
kss: {
// command: 'kss-node css styleguide --css css/styles.doc.css'
command: './node_modules/.bin/kss-node styleguide/dist/styleguide/css styleguide/styleguide --template styleguide/templates/infojobs --helpers styleguide/templates/helpers'
// command: 'kss-node dist/css styleguide --helpers templates/helpers'
}
}
});
grunt.loadNpmTasks('grunt-contrib-clean');
//grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-include-replace');
grunt.loadNpmTasks('grunt-text-replace');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-shell');
grunt.registerTask('default', ['clean', 'sass', 'copy:styleguide', 'includereplace', 'less', 'shell', 'replace', 'copy:allStyles', 'copy:copyFonts', 'copy:copyMedia', 'copy:copyJS', 'copy:copyHTML']);
grunt.registerTask('public', ['copy:copyRubik']);
};