-
-
Notifications
You must be signed in to change notification settings - Fork 79
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
Support Yarn Workspaces #27
Conversation
This one is blocking a release for us @NoahDragon, any chance it could get merged soon? |
@@ -86,7 +86,7 @@ entry.version = require('../package.json').version; | |||
|
|||
function loadModule(path, args) { | |||
return Promise.try(function() { | |||
var modulePath = pathFn.join(path, 'node_modules', 'hexo'); | |||
var modulePath = resolve.sync('hexo', { basedir: path }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is sufficient to use builtin require.resolve
since resolve
implements require.resolve
for browser-side support and hexo
does not, at least officially, support browser environment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough! At the time I discovered the resolve
package, node didn't export the right stuff. I've patched it!
Hey @JLHwung could you check out our changes and let us know if we can get this merged soon? Thanks so much! |
This reverts commit 618286b.
That issue should be resolved @JLHwung! |
Thanks @JLHwung! Would there be any chance you can look at this similar one? hexojs/hexo#3045 |
If docs are included as a part of the primary application via yarn workspaces (See https://yarnpkg.com/lang/en/docs/workspaces/) the module resolution for the main
hexo
package fails, because it is nested above.This PR addresses this issue by replacing the current custom module resolution with the resolve which implements the resolve algorithm.
This, in my opinion, fits the design requirements as well as extending it to allow for the yarn workspace issue without much hassle.