fix: svelte should find other package on yarn pnp#12563
fix: svelte should find other package on yarn pnp#12563sunrabbit123 wants to merge 4 commits intosveltejs:mainfrom
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.
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 testand lint the project withpnpm lintandpnpm checkChangesets
pnpm changesetand following the prompts. Changesets that add features should beminorand those that fix bugs should bepatch. Please prefix changeset messages withfeat:,fix:, orchore:.Edits