Skip to content

Commit 55f3aa2

Browse files
committed
Completed performance and msgs.
Completed the addition of performance metrics and improvements and firebase messaging 😊😊
1 parent 858fcd9 commit 55f3aa2

File tree

185 files changed

+7527
-1026
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

185 files changed

+7527
-1026
lines changed

β€Žangular.json

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,29 @@
3434
"styles": [
3535
"src/styles.scss"
3636
],
37-
"scripts": [],
37+
"scripts": [
38+
"src/app/workers/firebase-messaging-sw.js"
39+
],
3840
"serviceWorker": true,
3941
"ngswConfigPath": "ngsw-config.json"
4042
},
4143
"configurations": {
4244
"production": {
45+
"optimization": true,
46+
"sourceMap": true,
47+
"extractCss": true,
48+
"namedChunks": true,
49+
"aot": true,
50+
"extractLicenses": true,
51+
"vendorChunk": true,
52+
"buildOptimizer": true,
53+
"serviceWorker": true,
54+
"deleteOutputPath": true,
4355
"budgets": [
4456
{
4557
"type": "initial",
4658
"maximumWarning": "500kb",
47-
"maximumError": "1mb"
59+
"maximumError": "5mb"
4860
},
4961
{
5062
"type": "anyComponentStyle",

β€Žblog/2022-02-26-blog.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ description: 'blog description'
44
published: true
55
slugs: ['Hello','here']
66
tags: ['Programming']
7-
featuredImage: './assets/images/postImages/MyWebsiteAnditsfeatures/featuredImage.jpg'
7+
featuredImage: 'featuredImage'
88
authorName: 'Kumar Saptam'
9-
authorImage: './assets/authorImages/Kumar Saptam.jpg'
9+
authorImage: 'Kumar Saptam'
1010
date: 'Thursday 7th Nov 2021'
1111
---
1212

β€Žfirebase.json

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,27 @@
11
{
22
"hosting": {
33
"public": "dist/static",
4-
"ignore": [
5-
"firebase.json",
6-
"**/.*",
7-
"**/node_modules/**"
4+
"ignore": ["firebase.json", "**/.*", "**/node_modules/**"],
5+
"headers": [
6+
{
7+
"source": "**/*.@(jpg|webp|jpeg|gif|js|png|svg|webp|eot|otf|ttf|avif|ttc|woff|woff2|font.css)",
8+
"headers": [
9+
{
10+
"key": "Cache-Control",
11+
"value": "max-age=31536000"
12+
}
13+
]
14+
},
15+
{
16+
"source": "assets/**",
17+
"headers": [
18+
{
19+
"key": "Cache-Control",
20+
"value": "max-age=31536000"
21+
}
22+
]
23+
}
824
],
9-
"headers": [{
10-
"source": "**/*.@(jpg|webp|jpeg|gif|png|svg|webp|js|css|eot|otf|ttf|ttc|woff|woff2|font.css)",
11-
"headers": [ {
12-
"key": "Cache-Control",
13-
"value": "max-age=36000"
14-
}]
15-
}],
1625
"cleanUrls": true,
1726
"trailingSlash": false
1827
}

β€Žgulpfile.js

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
const { src, dest } = require("gulp");
2+
const sharpResponsive = require("gulp-sharp-responsive");
3+
const imagemin = require("gulp-imagemin");
4+
5+
const compressProjectImages = async () => {
6+
await src("src/assets/images/projectImages/*.{png,jpg}")
7+
.pipe(
8+
sharpResponsive({
9+
formats: [
10+
// jpeg
11+
{ width: 256, format: "jpeg", rename: { suffix: "-256" } },
12+
{ width: 512, format: "jpeg", rename: { suffix: "-512" } },
13+
{ width: 1024, format: "jpeg", rename: { suffix: "-1024" } },
14+
// webp
15+
{ width: 256, format: "webp", rename: { suffix: "-256" } },
16+
{ width: 512, format: "webp", rename: { suffix: "-512" } },
17+
{ width: 1024, format: "webp", rename: { suffix: "-1024" } },
18+
// avif
19+
{ width: 256, format: "avif", rename: { suffix: "-256" } },
20+
{ width: 512, format: "avif", rename: { suffix: "-512" } },
21+
{ width: 1024, format: "avif", rename: { suffix: "-1024" } },
22+
],
23+
})
24+
)
25+
.pipe(dest("src/assets/images/projectImages/compressed"));
26+
await src("src/assets/images/projectImages/compressed/*.{webp,avif,jpg}")
27+
.pipe(imagemin())
28+
.pipe(dest("src/assets/images/projectImages/compressed/"));
29+
};
30+
const compressAuthorImages = async () => {
31+
await src("src/assets/images/authorImages/*.{png,jpg}")
32+
.pipe(
33+
sharpResponsive({
34+
formats: [
35+
// jpeg
36+
{ width: 256, format: "jpeg", rename: { suffix: "-256" } },
37+
{ width: 512, format: "jpeg", rename: { suffix: "-512" } },
38+
// webp
39+
{ width: 256, format: "webp", rename: { suffix: "-256" } },
40+
{ width: 512, format: "webp", rename: { suffix: "-512" } },
41+
// avif
42+
{ width: 256, format: "avif", rename: { suffix: "-256" } },
43+
{ width: 512, format: "avif", rename: { suffix: "-512" } },
44+
],
45+
})
46+
)
47+
.pipe(dest("src/assets/images/authorImages/compressed"));
48+
await src("src/assets/images/authorImages/compressed/*.{webp,avif,jpg}")
49+
.pipe(imagemin())
50+
.pipe(dest("src/assets/images/authorImages/compressed/"));
51+
};
52+
const compressPostImages = async () => {
53+
await src("src/assets/images/postImages/*.{png,jpg}")
54+
.pipe(
55+
sharpResponsive({
56+
formats: [
57+
// jpeg
58+
{ width: 256, format: "jpeg", rename: { suffix: "-256" } },
59+
{ width: 512, format: "jpeg", rename: { suffix: "-512" } },
60+
{ width: 1024, format: "jpeg", rename: { suffix: "-1024" } },
61+
{ width: 1600, format: "jpeg", rename: { suffix: "-1600" } },
62+
// webp
63+
{ width: 256, format: "webp", rename: { suffix: "-256" } },
64+
{ width: 512, format: "webp", rename: { suffix: "-512" } },
65+
{ width: 1024, format: "webp", rename: { suffix: "-1024" } },
66+
{ width: 1600, format: "webp", rename: { suffix: "-1600" } },
67+
// avif
68+
{ width: 256, format: "avif", rename: { suffix: "-256" } },
69+
{ width: 512, format: "avif", rename: { suffix: "-512" } },
70+
{ width: 1024, format: "avif", rename: { suffix: "-1024" } },
71+
{ width: 1600, format: "avif", rename: { suffix: "-1600" } },
72+
],
73+
})
74+
)
75+
.pipe(dest("src/assets/images/postImages/compressed"));
76+
77+
await src("src/assets/images/postImages/compressed/*.{webp,avif,jpg}")
78+
.pipe(imagemin())
79+
.pipe(dest("src/assets/images/postImages/compressed/"));
80+
};
81+
82+
// compressAllImages = () =>
83+
// src("src/assets/images/**.{png,jpg}")
84+
// .pipe(imagemin())
85+
// .pipe(dest("src/assets/images/minified"));
86+
87+
module.exports = {
88+
compressProjectImages,
89+
compressAuthorImages,
90+
compressPostImages,
91+
};

0 commit comments

Comments
Β (0)