Skip to content

Commit fd71420

Browse files
committed
♿ improving lighthouse score
1 parent 95c0ad1 commit fd71420

File tree

6 files changed

+27
-5
lines changed

6 files changed

+27
-5
lines changed

i18n/en-US/components/Documentation.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,5 @@ topics:
7575
href: "/how-to-use-google-analytics-with-nullstack"
7676
- title: "How to use Facebook Pixel"
7777
href: "/how-to-use-facebook-pixel-with-nullstack"
78+
- title: "Nullstack Logo"
79+
href: "/nullstack-logo"

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,15 @@
1717
},
1818
"dependencies": {
1919
"@tailwindcss/typography": "^0.4.0",
20+
"glob": "^8.0.1",
2021
"nullsheet": "~0.2.0",
2122
"nullstack-google-analytics": "^1.0.0",
2223
"poisonicon": "^0.1.1",
2324
"postcss-cli": "^8.3.1",
2425
"prismjs": "^1.22.0",
26+
"purgecss-webpack-plugin": "^4.1.3",
2527
"remarkable": "^2.0.1",
2628
"remarkable-meta": "^1.0.1",
2729
"yaml": "^1.10.0"
2830
}
29-
}
31+
}

server.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ worker.preload = [
1616
'/arrow.webp',
1717
'/stars.webp',
1818
'/footer.webp',
19-
'/what-is-nullstack',
20-
'/documentation',
2119
'/contributors',
2220
'/roboto-v20-latin-300.woff2',
2321
'/roboto-v20-latin-500.woff2',

src/Application.njs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class Application extends Nullstack {
4242
renderHiringBanner() {
4343
return (
4444
<div class="p-3 md:p-0">
45-
<a class="bg-yellow-100 dark:bg-gray-800 py-2 flex justify-center items-center space-x-2 font-semibold flex-col md:flex-row px-6 text-center md:mt-2" href="https://ae.studio/jobs/4484720004/nullstack-developer" target="_blank">
45+
<a class="bg-yellow-100 dark:bg-gray-800 py-2 flex justify-center items-center space-x-2 font-semibold flex-col md:flex-row px-6 text-center md:mt-3" href="https://ae.studio/jobs/4484720004/nullstack-developer" target="_blank">
4646
<span class="text-gray-900 dark:text-white"> AE Studio is hiring Nullstack developers that get shit done! </span>
4747
<span class="text-pink-800 dark:text-pink-200"> Apply here. </span>
4848
</a>

src/Footer.njs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class Footer extends Translatable {
1414
title={title}
1515
target="_blank"
1616
rel="noopener"
17-
class="text-pink-600 hover:text-white inline-block"
17+
class="text-pink-600 hover:text-white inline-block h-12 w-12 flex items-center justify-center"
1818
>
1919
<Icon size={45} />
2020
</a>

webpack.config.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
const [server, client] = require('nullstack/webpack.config');
2+
3+
const glob = require('glob');
4+
const PurgecssPlugin = require('purgecss-webpack-plugin');
5+
6+
function customClient(...args) {
7+
const config = client(...args);
8+
if (config.mode === 'production') {
9+
config.plugins.push(new PurgecssPlugin({
10+
paths: glob.sync(`src/**/*`, { nodir: true }),
11+
content: ['./**/*.njs'],
12+
safelist: ['script', 'body', 'html', 'style'],
13+
defaultExtractor: content => content.match(/[^<>"'`\s]*[^<>"'`\s:]/g) || [],
14+
}));
15+
}
16+
17+
return config;
18+
}
19+
20+
module.exports = [server, customClient]

0 commit comments

Comments
 (0)