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

Does not work with yarn workspaces #23

Closed
hayes opened this issue May 5, 2021 · 1 comment
Closed

Does not work with yarn workspaces #23

hayes opened this issue May 5, 2021 · 1 comment

Comments

@hayes
Copy link
Contributor

hayes commented May 5, 2021

Currently denoify does not work well with packages inside yarn workspaces because modules are mostly hoisted into the root node_modules directory.

getInstalledVersionPackageJsonFactory can't find these packages when they are hoisted.

One way to fix this would be to use require.resolve instead by doing something like:

return require.resolve(nodeModuleName, {paths: [projectPath]}).replace(/^(.*\/node_modules\/[^/]*).*/, '$1');

insttead of

return st.find_module_path(nodeModuleName, projectPath);
@garronej
Copy link
Owner

garronej commented May 5, 2021

Fantastic investigation

garronej added a commit that referenced this issue May 5, 2021
@garronej garronej closed this as completed May 6, 2021
gitbook-com bot pushed a commit that referenced this issue Oct 22, 2022
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

No branches or pull requests

2 participants