-
Notifications
You must be signed in to change notification settings - Fork 23
/
Gruntfile.js
97 lines (96 loc) · 2.5 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
const fonts = [
'regular', 'outlined', 'round', 'sharp', 'two-tone'
];
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
sass: {
dist: {
options: {
sourcemap: 'none',
unixNewlines: true,
lineNumbers: false,
},
files: [
// // fonts + icons bundle
// ...fonts.map(font => ({
// dest: `css/material-icons-${font}-bundle.css`,
// src: [
// 'scss/material-icons.scss',
// `scss/material-icons-${font}.scss`
// ]
// })),
{
// only fonts
...Object.fromEntries(fonts.map(font => ([
`css/material-icons-${font}.css`, `scss/material-icons-${font}.scss`
]))),
// // fonts + icons bundle
// ...Object.fromEntries(fonts.map(font => ([
// `css/material-icons-${font}-bundle.css`, [
// `scss/material-icons-${font}.scss, scss/material-icons.scss`
// ]
// ]))),
// only icons
'css/material-icons-base.css': 'scss/base.scss',
// all fonts + icons bundle
'css/material-icons.css': 'scss/bundle.scss'
}
],
},
demo: {
options: {
sourcemap: 'none',
unixNewlines: true,
lineNumbers: true,
},
files: {
'demo/style/main.css': 'demo/style/main.scss'
}
},
},
cssmin: {
options: {
sourceMap: true
},
target: {
files: [{
expand: true,
cwd: 'css',
src: ['*.css', '!*.min.css'],
dest: 'css',
ext: '.min.css'
}, {
expand: true,
cwd: 'demo/style',
src: ['*.css', '!*.min.css'],
dest: 'demo/style',
ext: '.min.css'
}]
}
},
watch: {
css: {
files: [
'scss/*.scss',
'demo/style/*.scss'
],
tasks: ['sass']
}
},
shell: {
updateRepo: {
options: {
stdout: true
},
command: 'python3 scripts/update_repo.py'
}
}
});
grunt.loadNpmTasks('grunt-shell');
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.registerTask('build', ['shell', 'sass', 'cssmin']);
grunt.registerTask('default', ['sass', 'watch']);
}