Closed yannickl88 closed 3 years ago
I think the idea is that Node, Webpack, and Browserify will use main to pull in the file and then that file will get transpiled if it needs.
Do you have an example of something different?
Also, dist
is meant to be a UMD-style version of the package.
jQuery does something different https://github.com/jquery/jquery/blob/master/package.json#L6 and the factory method it's a common pattern I see everywhere. Even in your dist/index.js.
Should the
main
file not be the one in the dist folder? Because that file has better compatibility for different javascript loaders.https://github.com/scottcorgan/tiny-emitter/blob/master/index.js
vs
https://github.com/scottcorgan/tiny-emitter/blob/master/dist/tinyemitter.js