forked from m-spyratos/bootstrap-4-grid
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
142 lines (126 loc) · 3.76 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
module.exports = function (grunt) {
grunt.initConfig({
/**
* Bootstrap path in node modules.
*/
boostrap_sass_path: 'node_modules/bootstrap/scss',
/**
* Copy the necessary files from bootstrap node module,
* to the scss folder.
*/
copy: {
grid: {
files: [
{
expand: true,
cwd: '<%= boostrap_sass_path %>',
src: [
'bootstrap-grid.scss',
'utilities/_display.scss',
'utilities/_flex.scss',
'utilities/_spacing.scss',
'mixins/_breakpoints.scss',
'mixins/_grid-framework.scss',
'mixins/_grid.scss',
'_variables.scss',
'_functions.scss',
'_grid.scss'
],
dest: 'scss/grid/'
}
]
},
layout: {
files: [
{
expand: true,
cwd: '<%= boostrap_sass_path %>',
src: [
'utilities/_display.scss',
'utilities/_spacing.scss',
'utilities/_position.scss',
'utilities/_visibility.scss',
'mixins/_visibility.scss'
],
dest: 'scss/layout/'
}
]
},
sizing: {
files: [
{
expand: true,
cwd: '<%= boostrap_sass_path %>',
src: [
'utilities/_sizing.scss'
],
dest: 'scss/sizing/'
}
]
},
breakpoints: {
files: [
{
expand: true,
cwd: '<%= boostrap_sass_path %>',
src: [
'mixins/_breakpoints.scss'
],
dest: 'scss/breakpoints/'
}
]
}
},
/**
* Compile the sass files to css.
*/
sass: {
dist: {
options: {
style: 'compressed',
sourcemap: 'none'
},
files: {
'css/grid.min.css': 'scss/grid.scss'
}
},
dev: {
options: {
style: 'expanded',
sourcemap: 'none'
},
files: {
'css/grid.css': 'scss/grid.scss'
}
}
},
/**
* Prefix css files with the autoprefixer plugin of postcss.
*/
postcss: {
options: {
map: false,
processors: [
require('autoprefixer')
]
},
dist: {
src: 'css/*.css'
}
}
});
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-postcss');
grunt.registerTask('build', [
'copy',
'sass',
'postcss'
]);
grunt.registerTask('browser', [
'postcss'
]);
grunt.registerTask('default', [
'build'
]);
};