front-matter icon indicating copy to clipboard operation
front-matter copied to clipboard

Very large size in browser bundle

Open alex996 opened this issue 4 years ago • 1 comments

When bundled for browsers, this modules adds over 170 KB in bundle size via js-yaml (38 KB) and its dependency esprima (130 KB). You can verify the estimated size on bundlephobia.

I noticed that this isn't limited to front-matter. Other packages like gray-matter and yaml-front-matter are in the same 170+ KB ballpark size. However, it's worth mentioning this in the readme (looks like it's one of the todos in #37) because the added size makes this package unsuitable for browsers.

Using a different/custom parser may solve this issue.

alex996 avatar Jul 02 '21 02:07 alex996

+1

front-matter and gray-matter are using [email protected] which listed esprima as a dependency, but the latest version of js-yaml is not listing it as a dependency anymore.

Probably front-matter to use the latest version of js-yaml would solve this browser bundle size issue.

szilarddoro avatar Oct 07 '21 07:10 szilarddoro