Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

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