{"action":"created","issue":{"url":"https://api.github.com/repos/mikemaccana/sass-npm/issues/2","labels_url":"https://api.github.com/repos/mikemaccana/sass-npm/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/mikemaccana/sass-npm/issues/2/comments","events_url":"https://api.github.com/repos/mikemaccana/sass-npm/issues/2/events","html_url":"https://github.com/mikemaccana/sass-npm/issues/2","id":123491919,"number":2,"title":"Makes assumptions about project structure when doing `require.resolve`","user":{"login":"lennym","id":117398,"avatar_url":"https://avatars.githubusercontent.com/u/117398?v=3","gravatar_id":"","url":"https://api.github.com/users/lennym","html_url":"https://github.com/lennym","followers_url":"https://api.github.com/users/lennym/followers","following_url":"https://api.github.com/users/lennym/following{/other_user}","gists_url":"https://api.github.com/users/lennym/gists{/gist_id}","starred_url":"https://api.github.com/users/lennym/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lennym/subscriptions","organizations_url":"https://api.github.com/users/lennym/orgs","repos_url":"https://api.github.com/users/lennym/repos","events_url":"https://api.github.com/users/lennym/events{/privacy}","received_events_url":"https://api.github.com/users/lennym/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-12-22T14:38:46Z","updated_at":"2015-12-23T09:53:51Z","closed_at":null,"body":"I've been having some thoughts about module resolution as a result of doing [some work](https://github.com/lennym/npm-sass/pull/1) on another (greatly superior) npm-based sass resolver...\r\n\r\n`require.resolve` returns whatever file is specified in the \"main\" property of package.json, which might not be the module root. So what your module's actually doing is looking for styles.scss in the same directory as the \"main\" file, not necessarily the project root. To reliably get the root, you'd need to `findup` to a package.json (I think). A bit like https://github.com/lennym/npm-sass/blob/feature/recursion/lib/npm-sass.js#L36\r\n\r\nANOTHER IDEA: You might want to read the package.json of the dependent module, and see if it has a \"styles\" property or something like that to direct sass-npm to a particular file (like \"main\" does for js files), which defaults to ./styles.scss."},"comment":{"url":"https://api.github.com/repos/mikemaccana/sass-npm/issues/comments/166850553","html_url":"https://github.com/mikemaccana/sass-npm/issues/2#issuecomment-166850553","issue_url":"https://api.github.com/repos/mikemaccana/sass-npm/issues/2","id":166850553,"user":{"login":"lennym","id":117398,"avatar_url":"https://avatars.githubusercontent.com/u/117398?v=3","gravatar_id":"","url":"https://api.github.com/users/lennym","html_url":"https://github.com/lennym","followers_url":"https://api.github.com/users/lennym/followers","following_url":"https://api.github.com/users/lennym/following{/other_user}","gists_url":"https://api.github.com/users/lennym/gists{/gist_id}","starred_url":"https://api.github.com/users/lennym/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lennym/subscriptions","organizations_url":"https://api.github.com/users/lennym/orgs","repos_url":"https://api.github.com/users/lennym/repos","events_url":"https://api.github.com/users/lennym/events{/privacy}","received_events_url":"https://api.github.com/users/lennym/received_events","type":"User","site_admin":false},"created_at":"2015-12-23T09:53:51Z","updated_at":"2015-12-23T09:53:51Z","body":"Link: https://github.com/lennym/npm-sass/pull/1/files"}}