contents
contents copied to clipboard
Improve package size
The package is quite heavy (actually too heavy) with having full "babel": "^5.8.23" as dependency. As far as I can see only babel-polyfill is need. Is that correct?
If yes, would it make sense / possible to replace this with babel-polyfill or babel-runtime (or even just core-js only) and move babel to devDependencies?
As far as I can tell, you are right. In fact, "browser" bundle ought to be removed altogether. There is no good use case, everyone is using a package manager these days (or should be).
I cannot think of a reason for needing Babel as a dependency. I'd be happy to investigate further. However, the code base is quite out of sync with my current workflow. I have recently brought one of the libraries that I maintain up to speed (see https://github.com/gajus/swing/pull/86). If you could raise an equivalent PR, I'd be happy to investigate the bundle size.
I was rather worrying about the dependency tree rather than the actual (browser) bundle size. Bundle actually increased a bit ... probably due to the newer core-js, however, as you said most people probably don't care and using it as a package dependency rather than as browser bundle.
Doesn't it make sense ?
It makes sense. I don't have a use case for contents package at the moment. Therefore, prioritising its development over active dependencies would be irrational. However, if there is a Good Samaritan that wants to contribute a PR, I am happy to review it and release it if appropriate.
Sorry, I was referring to both my reasoning and the respective PR https://github.com/gajus/contents/pull/21