Comments (7)
Can you check the issues, it's been discussed. It's impossible. Or: feel free to spend like a month on this if you really want it.
Also: I think svelte itself also is like: yeah, no, not going to happen.
from import-meta-resolve.
I have made it work with the above code, so it's not impossible. It you can change the resolver to add those few lines of code to detect pnp, then it will work fine. I'm happy to help here.
Old comments about yarn pnp not working with svelte are no longer true, as bugs have been fixed.
from import-meta-resolve.
This pkg is a ton of code, it’s a copy of the actual node internals. Just using require isn’t going to work on ESM files for this project. If that’s all your use case, then that’s fine for you?
I meant Rich’s comments on not being interested in supporting PnP
from import-meta-resolve.
Please see #23 (comment) and the above and related threads, which include the yarn maintainer
from import-meta-resolve.
This pkg is a ton of code, it’s a copy of the actual node internals. Just using require isn’t going to work on ESM files for this project. If that’s all your use case, then that’s fine for you?
This package will only be loaded in the PnP case, so it won't penalize anyone else.
I have not investigated how to do the fix with the ESM portions of your code, as I don't require that, but I'm sure something similar can be done in your code to handle this. If necessary we can get help from the yarn folks like @arcanis who have been very active in helping with exactly these situation. I'm willing to help too.
As I said before, I have resolved my problem by patching Prettier and bypassing the call to this package, but I'm trying to advocate for a broader fix which will help more people.
I meant Rich’s comments on not being interested in supporting PnP
Yes, I have seen this. I find it not very useful or helpful. Svelte does not need to do anything directly to support PnP, the issues are with underlying packages (like this one). His comment is also quite old. yarn pnp is very actively developed and constantly improving.
from import-meta-resolve.
Ok well #23 (comment) still stands. I think it’s going to take several weeks for someone to implement. It would be a fork of this project or a completely different project. If someone wants to make that, we can talk again after that.
It basically means copy/pasting a lot of Node into a project. At that point, using Node itself seems simpler to me.
from import-meta-resolve.
See PR #28
from import-meta-resolve.
Related Issues (18)
- Issues with loading from ESM, "type": "module", & rollup HOT 2
- Enabling usage of this package in an eslint plugin HOT 8
- Support for TypeScript files HOT 13
- Use module.builtinModules instead of builtins dependency HOT 1
- how to resolve named exports? HOT 5
- Yarn PnP compatibility? HOT 18
- Want help on maintenance? HOT 4
- Circular dependency in lib/get-format.js HOT 1
- `import.meta.resolve` is now defined to be _sync_ HOT 1
- Possible to use worker threads and execArgv? HOT 14
- exporting the `packageResolve` function HOT 2
- Support for resolving modules from folder paths HOT 8
- First item is always resolved when export map target is Array (even if non-existent) HOT 8
- Resolve fails on MacOS and Windows, works on linux HOT 7
- Incompatible with yarn P'n'P HOT 12
- unexpected `ERR_PACKAGE_PATH_NOT_EXPORTED` thrown HOT 8
- [DEP0180] DeprecationWarning: fs.Stats constructor is deprecated in Node v22.0.0 HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from import-meta-resolve.