-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathGruntfile.js
104 lines (86 loc) · 2.13 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
module.exports = function(grunt) {
var config = {};
//src ===============================
var src;
config.src = src = {
sassMain: 'themes/malt/scss/main.scss',
distFolder: 'themes/malt/public/stylesheets/it-in-dublin.dist.css',
devFolder: 'themes/malt/public/stylesheets/it-in-dublin.dev.css',
sassFolder: 'themes/malt/scss/**/*.scss',
serverPort: 8000
};
//Concat ===============================
var concat
config.concat = concat = {};
concat.dev = {
files: {
"themes/malt/static/css/it-style.css": [
"themes/malt/static/css/*.css"
]
}
};
//Watch ===============================
config.watch = {
scripts: {
files: ["<%= src.sassFolder %>"],
tasks: ["sass:dist"]
}
}
//Sass ===============================
var sass;
config.sass = sass = {};
//sass distribution
sass.dist = {
options: {
style: "compressed",
noCache: true,
sourcemap: 'none',
update: true
},
files: {
"<%= src.distFolder %>": "<%= src.sassMain %>"
}
};
//sass development env.
sass.dev = {
options: {
style: "expanded",
lineNumber: true,
},
files: {
"<%= src.devFolder %>": "<%= src.sassMain %>"
}
};
var cssmin
config.cssmin = {
target: {
files: [{
expand: true,
cwd: 'themes/malt/static/css',
src: ['it-style.css'],
dest: 'themes/malt/static/css/',
ext: '.min.css'
}]
}
}
//grunt serve ===============================
config.connect = {
server: {
options: {
livereload: true,
port: "<%= src.serverPort %>"
}
}
};
//Register custom tasks ===============================
grunt.registerTask('default', ['dev']);
grunt.registerTask('dev', ['concat:dev', 'sass:dev']);
grunt.registerTask('dist', ['concat:dev', 'sass:dist']);
grunt.registerTask('serve', ['connect:server', 'watch']);
require('time-grunt')(grunt);
require('load-grunt-tasks')(grunt, {
scope: 'devDependencies'
});
//General setup ===============================
grunt.initConfig(config);
};