iconic / open-iconic

An open source icon set with 223 marks in SVG, webfont and raster formats
http://useiconic.com/open
Other
3.58k stars 421 forks source link

Add 'main' entry point to package.json #31

Open BitBrit opened 6 years ago

BitBrit commented 6 years ago

My build system in a package requires a method of discovering the location of a package dependency (in this case, the open-iconic package). Depending on how I use our package the location of this open-iconic package changes relative to the build script. The details of why this is are not really important but suffice to say that I need a way to locate the package within node_modules.

There is already a handy function which does this called require.resolve() which is in nodejs but method uses the location of the entry point of a package (specified by the "main" property in package.json) as the path to return. Without "main" being specified in package.json require.resolve() fails.

This PR adds that entry point as thefont/css/open-iconic.css file. In reality it doesn't matter if this entry point it the one chosen or not. I just need the entry point to be within the package so feel free to change it to suit your needs.

Thanks.