Hey guys,
I'm not sure that it's a bug, and now I'm here just to ask.
When I create an empty project:
{
"name": "test",
"devDependencies": {
"size-limit": "^0.21.1"
},
"size-limit": [
{
"path": "file.css",
"limit": "5 KB"
}
]
}
and add there an empty CSS file:
$ ls -la file.css
-rw-r--r-- 1 user group 0 Mar 28 13:50 file.css
and then run size-limit
I get this:
Package size: 2.27 KB
Size limit: 5 KB
With all dependencies, minified and gzipped
As I understand the root of the problem is webpack's config and loaders that size-limit uses for calculating the size. When I disable webpack adding webpack: false
to package.json, everything is fine:
Package size: 0 B
Size limit: 5 KB
With all dependencies, minified and gzipped
But I'm not sure that it's a right way to calculate size. I mean, as far as I understand, README says that:
Webpack inside Size Limit is very useful for small open source library. But if you want to use Size Limit for application, not open source library, you could already have webpack to make bundle.
In this case you can disable internal webpack.
So, technically, I started to create a library, but without webpack. And according to README my option is to use default value (webpack: true
). Am I wrong?
Anyway, I don't think that was a right output for an empty file.