Skip to content

Conversation

@BitBrit
Copy link

@BitBrit BitBrit commented Nov 15, 2017

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant