-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlighthouserc.js
40 lines (35 loc) · 1.03 KB
/
lighthouserc.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
const fs = require('fs');
const { basename, join } = require('path');
const { createServer } = require('@lhci/server');
const makeURLS = () => {
const Prefix = 'https://hj-devlog.vercel.app/';
const postPath = join(process.cwd(), 'posts');
const postSlug = fs.readdirSync(postPath);
const allPostPath = postSlug.map((post) => {
return Prefix + 'blog/' + encodeURIComponent(post.replace('.md', ''));
});
return {
allPostPaths: [...allPostPath, Prefix, Prefix + 'about'],
};
};
module.exports = {
ci: {
assert: {
assertions: {
'categories:performance': ['warn', { minScore: 0.9 }],
'categories:accessibility': ['warn', { minScore: 0.9 }],
'categories:best-practices': ['warn', { minScore: 0.9 }],
'categories:seo': ['warn', { minScore: 0.9 }],
},
},
server: {},
collect: {
startServerCommand: 'npm run start',
url: makeURLS().allPostPaths,
},
upload: {
target: 'temporary-public-storage',
outputDir: '/lhci_reports',
},
},
};