Hi everyone !
I am working on code splitting and import() function to be transpilled to use CDN.
So my goal is the user write sth like
import(‘lodash’).then(lodashDefault => mod.get(…))
and under the hood it is transpile with a module in sth like
cdnjs.import(‘lodash’).then(lodashDefault => …)
I have already something that is working based on unpkg but the pain point is asking the dev to provide the mapping between the package name and the path and the global variable.
Then I have discovered cdnjs … while using codepen.
By the way even in codepen when you have added let react you have to know the global var is React.
Devs don t want to search for that.
lodash global is _
react global is React
So I would like to leverage the work you guys did on the packages repository and start adding this global metadata.
I know this one can not be applied to every package (like jquery plugins which are attached to global jquery) but we could propose a jsonpath.
So first thing what do you think about it ?