Skip to content

Conversation

@dpvc
Copy link
Member

@dpvc dpvc commented Aug 17, 2020

This PR improves the mechanism for getting the root directory for the version of node-main that is running. It uses eval() to get access to the actual node version of the path library and the __dirname variable rather than the webpack versions of them, which was what was causing problems before. This means we don't have to do all the hacks to handle Windows or use the error object to look up the path; we can use use eval('__dirname') and path as we would expect to. This works since node-main.js is only for use in node, not sin the browser itself, where those values don't exist.

See mathjax/MathJax#2486.

@dpvc dpvc requested a review from zorkow August 17, 2020 17:53
Copy link
Member

@zorkow zorkow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is much nicer and cleaner. I've tested it and it works.

@dpvc
Copy link
Member Author

dpvc commented Aug 19, 2020

This is much nicer and cleaner.

Yes, I thought so, too. I think this eliminates all the hacks.

I've tested it and it works.

Great, thanks!

@dpvc dpvc added this to the v3.1.0 milestone Aug 19, 2020
@dpvc dpvc merged commit d023db6 into develop Aug 19, 2020
@dpvc dpvc deleted the better-path branch August 19, 2020 12:11
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.

3 participants