forked from mui/material-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.size-limit.js
44 lines (41 loc) · 1.04 KB
/
.size-limit.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
const fs = require('fs');
function getMainFile() {
const dirname = '.next/static/commons';
const files = fs.readdirSync(dirname);
const [file] = files
.reduce((result, filename) => {
if (!/^main-[a-f0-9]+\.js$/.test(filename)) {
return result;
}
const path = `${dirname}/${filename}`;
return [...result, { path, ctime: fs.statSync(path).ctimeMs }];
}, [])
.sort((x, y) => y.ctime - x.ctime);
return file;
}
module.exports = [
{
name: 'The initial cost people pay for using one component',
webpack: true,
path: 'packages/material-ui/build/Paper/index.js',
limit: '17.7 KB',
},
{
name: 'The size of all the modules of material-ui.',
webpack: true,
path: 'packages/material-ui/build/index.js',
limit: '95.4 KB',
},
{
name: 'The main bundle of the docs',
webpack: false,
path: getMainFile().path,
limit: '179 KB',
},
{
name: 'The home page of the docs',
webpack: false,
path: '.next/bundles/pages/index.js',
limit: '5.9 KB',
},
];