-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
fix: svelte should find other package on yarn pnp #12563
Conversation
|
Signed-off-by: sunrabbit123 <qudwls185@naver.com>
Signed-off-by: sunrabbit123 <qudwls185@naver.com>
https://nodejs.org/docs/latest/api/esm.html#importmetaresolvespecifier |
On double checking, it seems to be a problem with the esm and commonjs. I'm sorry. |
nodejs/node#49028 And as a result, we can rely on the loader to import dependencies, even if we don't have that flag. (wooorm/import-meta-resolve#10 (comment)) Besides this, I think something has changed, but I can't find it. |
Signed-off-by: sunrabbit123 <qudwls185@naver.com>
return import.meta.resolve(dependency); | ||
} | ||
// @ts-expect-error the types are wrong | ||
return imr.resolve(dependency, pathToFileURL(process.cwd() + '/dummy.js')); |
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.
I want remove this, but i don't know side effect
good idea, I look forward to a quick merge |
fix resolve_peer_dependency function for yarn pnp
description
As you can see from #5353, the problem is bothering yarn pnp users.
This is PR that I hope that the yarn pnp users can enjoy Svelte under certain conditions.
detail
wooorm/import-meta-resolve#10 (comment)
The author of the import-meta-resolve in question is not interested in the yarn pnp issue, will not be, and talked as below.
"Then there would be significant differences between when the actual import.meta.resolve is available and when not. As in, Yarn PnP wouldn’t work on old Node. At that point, just use import.meta.resolve?"
I modified the node version to call import.meta.resolve accordingly.
import meta resolve
https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Operators/import.meta
Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
Tests
pnpm test
and lint the project withpnpm lint
andpnpm check
Changesets
pnpm changeset
and following the prompts. Changesets that add features should beminor
and those that fix bugs should bepatch
. Please prefix changeset messages withfeat:
,fix:
, orchore:
.Edits