Skip to content

Commit c7843a0

Browse files
author
aFarkas
committed
add perfbudget
1 parent d97ec77 commit c7843a0

File tree

4 files changed

+58
-35
lines changed

4 files changed

+58
-35
lines changed

Gruntfile.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,17 @@
5353
'assets/css/tidy.css': ['index.html', 'maxdpr/*.html']
5454
}
5555
}
56+
},
57+
maxFilesize: {
58+
options: {
59+
// Task-specific options go here.
60+
},
61+
minified: {
62+
options: {
63+
maxBytes: 5999
64+
},
65+
src: ["lazysizes.min.js"]
66+
}
5667
}
5768
});
5869

@@ -62,10 +73,11 @@
6273
grunt.loadNpmTasks("grunt-contrib-watch");
6374
grunt.loadNpmTasks('grunt-uncss');
6475
grunt.loadNpmTasks('grunt-bytesize');
76+
grunt.loadNpmTasks('grunt-max-filesize');
6577

6678

6779
// Default task.
68-
grunt.registerTask("default", [ "test", "uglify", "bytesize" ]);
80+
grunt.registerTask("default", [ "test", "uglify", "bytesize", "maxFilesize" ]);
6981
grunt.registerTask("test", [ "jshint" ]);
7082
};
7183
})();

lazysizes.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,8 +250,6 @@
250250
elem.removeAttribute(lazySizesConfig.srcAttr);
251251
}
252252
}
253-
254-
255253
}
256254
}
257255

optimumx/child.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@
162162
https://farm6.staticflickr.com/5531/9638435181_ecbab20fc0_h.jpg 1600w,
163163
https://farm6.staticflickr.com/5531/9638435181_9da37d35d4_k.jpg 2048w,
164164
https://farm6.staticflickr.com/5531/9638435181_6b5ed94330_o.jpg 3648w"
165-
data-optimumx="1.6"
165+
data-optimumx="1.7"
166166
alt="Desert Road" />
167167
</div>
168168
</td>
@@ -246,7 +246,7 @@
246246
https://farm9.staticflickr.com/8200/8248153196_439515a267_h.jpg 1600w,
247247
https://farm9.staticflickr.com/8200/8248153196_891960c5f5_k.jpg 2048w,
248248
https://farm9.staticflickr.com/8200/8248153196_c259fd3d58_o.jpg 9910w"
249-
data-optimumx="1.6"
249+
data-optimumx="1.5"
250250
alt="@ The Desert Tortoise Natural Area" />
251251

252252
</div>
@@ -518,7 +518,7 @@
518518
https://farm4.staticflickr.com/3059/2835191823_e3636abb34_z.jpg 640w,
519519
https://farm4.staticflickr.com/3059/2835191823_e3636abb34_b.jpg 1024w,
520520
https://farm4.staticflickr.com/3059/2835191823_c3bdbcbbee_o.jpg 3028w"
521-
data-optimumx="1.3"
521+
data-optimumx="1.4"
522522
alt="el castil de tierra" />
523523

524524
</div>
@@ -610,7 +610,7 @@
610610
https://farm6.staticflickr.com/5506/11122805655_2992b75835_h.jpg 1600w,
611611
https://farm6.staticflickr.com/5506/11122805655_a6418efdc5_k.jpg 2048w,
612612
https://farm6.staticflickr.com/5506/11122805655_c2bf7d14ea_o.jpg 3008w"
613-
data-optimumx="2"
613+
data-optimumx="2.2"
614614
alt="Sky and earth" />
615615

616616
</div>
@@ -651,7 +651,7 @@
651651
https://farm4.staticflickr.com/3023/2994603808_a3036a3cdf_z.jpg 480w,
652652
https://farm4.staticflickr.com/3023/2994603808_a3036a3cdf_b.jpg 768w,
653653
https://farm4.staticflickr.com/3023/2994603808_8ac98ed34d_o.jpg 3648w"
654-
data-optimumx="1.5"
654+
data-optimumx="1.4"
655655
alt="Missing Ulsoor lake (Explore)" />
656656

657657
</div>

package.json

Lines changed: 40 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,42 @@
11
{
2-
"name": "lazysizes",
3-
"version": "0.5.0",
4-
"author": "Alexander Farkas <[email protected]>",
5-
"repository": {
6-
"type": "git",
7-
"url": "git://github.com/aFarkas/lazysizes.git"
8-
},
9-
"browser": "lazysizes.js",
10-
"devDependencies": {
11-
"grunt": "~0.4.2",
12-
"grunt-cli": "~0.1",
13-
"grunt-contrib-jshint": "~0.10.0",
14-
"grunt-contrib-uglify": "~0.2.0",
15-
"grunt-contrib-watch": "~0.4.0",
16-
"grunt-bytesize": "~0.1.1",
17-
"grunt-uncss": "~0.3.7"
18-
},
19-
"autoupdate": {
20-
"source": "git",
21-
"target": "git://github.com/afarkas/lazysizes.git",
22-
"basePath": "",
23-
"files": [
24-
"lazysizes.min.js"
25-
]
26-
},
27-
"description": "High performance (jankfree) lazy loader for images (including responsive images), iframes and scripts (widgets).",
28-
"keywords": ["lazy", "loader", "lazyloader", "performance", "responsive", "image", "responsive images", "picture", "srcset", "respimg", "respimage"]
2+
"name": "lazysizes",
3+
"version": "0.5.0",
4+
"author": "Alexander Farkas <[email protected]>",
5+
"repository": {
6+
"type": "git",
7+
"url": "git://github.com/aFarkas/lazysizes.git"
8+
},
9+
"browser": "lazysizes.js",
10+
"devDependencies": {
11+
"grunt": "~0.4.2",
12+
"grunt-bytesize": "~0.1.1",
13+
"grunt-cli": "~0.1",
14+
"grunt-contrib-jshint": "~0.10.0",
15+
"grunt-contrib-uglify": "~0.2.0",
16+
"grunt-contrib-watch": "~0.4.0",
17+
"grunt-max-filesize": "^0.1.0",
18+
"grunt-uncss": "~0.3.7"
19+
},
20+
"autoupdate": {
21+
"source": "git",
22+
"target": "git://github.com/afarkas/lazysizes.git",
23+
"basePath": "",
24+
"files": [
25+
"lazysizes.min.js"
26+
]
27+
},
28+
"description": "High performance (jankfree) lazy loader for images (including responsive images), iframes and scripts (widgets).",
29+
"keywords": [
30+
"lazy",
31+
"loader",
32+
"lazyloader",
33+
"performance",
34+
"responsive",
35+
"image",
36+
"responsive images",
37+
"picture",
38+
"srcset",
39+
"respimg",
40+
"respimage"
41+
]
2942
}

0 commit comments

Comments
 (0)