The plugin for Size Limit to track JS download and execution time by estimo and Puppeter.
By default, Size Limit measures the loading time of your files using a slow 3G network (50 kB/s) without latency. You can customize these settings for each check by modifying your Size Limit configuration:
- Install the preset:
npm install --save-dev size-limit @size-limit/file @size-limit/time
- Add the size-limit config:
// .size-limit.js
export default [
{
path: 'index.js',
time: {
networkSpeed: '5 MB', // Custom network speed for loading files
latency: '800 ms', // Custom network latency
loadingMessage: 'on fast 4G' // Custom message in output
}
}
]
- After configuring, run Size Limit to check the customized loading time:
$ npm run size-limit
Package size: 998.6 kB
Loading time: 200 ms on fast 4G
Running time: 214 ms on Snapdragon 410
Total time: 1.3 s
See Size Limit docs for more details.