-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
95 lines (95 loc) · 2.58 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
module.exports = function(grunt) {
// Project configuration
grunt.initConfig({
sass: { // Task
dist: { // Target
options: { // Target options
style: 'compressed'
},
files: { // Dictionary of files
'style.css': 'sass/style.scss' // 'destination': 'source'
}
}
},
criticalcss: {
home: {
options: {
url: "https://olegs.be/",
width: 1200,
height: 900,
outputfile: "critical-home.css",
filename: "style.css", // Using path.resolve( path.join( ... ) ) is a good idea here
buffer: 800*1024,
ignoreConsole: false
}
},
about: {
options: {
url: "https://olegs.be/product-manager-torino-web-performance-user-experience/",
width: 1200,
height: 900,
outputfile: "critical-about.css",
filename: "style.css", // Using path.resolve( path.join( ... ) ) is a good idea here
buffer: 800*1024,
ignoreConsole: false
}
},
landing: {
options: {
url: "https://olegs.be/ottimizzazione-prestazioni-velocita-sito-web-lento/",
width: 1200,
height: 900,
outputfile: "critical-landing.css",
filename: "style.css", // Using path.resolve( path.join( ... ) ) is a good idea here
buffer: 800*1024,
ignoreConsole: false
}
},
blog: {
options: {
url: "https://olegs.be/blog/",
width: 1200,
height: 900,
outputfile: "critical-blog.css",
filename: "style.css", // Using path.resolve( path.join( ... ) ) is a good idea here
buffer: 800*1024,
ignoreConsole: false
}
},
photos: {
options: {
url: "https://olegs.be/photos/",
width: 1200,
height: 900,
outputfile: "critical-photos.css",
filename: "style.css", // Using path.resolve( path.join( ... ) ) is a good idea here
buffer: 800*1024,
ignoreConsole: false
}
},
gallery: {
options: {
url: "https://olegs.be/gallery/turin-italy/",
width: 1200,
height: 900,
outputfile: "critical-gallery.css",
filename: "style.css", // Using path.resolve( path.join( ... ) ) is a good idea here
buffer: 800*1024,
ignoreConsole: false
}
},
},
watch: {
css: {
files: ['sass/*.css', 'sass/*.scss'],
tasks: ['sass'],
},
},
});
// Load Tasks
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-criticalcss');
grunt.loadNpmTasks('grunt-contrib-watch');
// Register Tasks
grunt.registerTask('default', ['sass', 'criticalcss', 'watch']);
};