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.
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.jsonrequire.resolve()
fails.This PR adds that entry point as the
font/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.