Comments (2)
Thank you for your swift response, and for pointing me to nodejs/node#49445!
After reading the whole thread this morning, I added missing tests on my library and started a little refactoring: it turns out moduleResolve
does the job for my use case, with the added benefit of now supporting import maps.
Thank you for your guidance 😄
from import-meta-resolve.
Yo Pierre!
Now that import.meta.resolve
in Node is a release candidate, I expect it to be unflagged soonish. If that happens, that would likely/hopefully be backported to v18. Which is EOL at 2025-04-30, at which point this package is no longer needed, at which point you’d need a maintained version.
So perhaps pushing for nodejs/node#49445 I think might be better?
Anyway, feel free to PR this for now.
Actually, given 49445, perhaps return the folder URL (as a string) instead of the package.json URL? That would make it useful more broadly. And then we kinda polyfill that import.meta
idea!
from import-meta-resolve.
Related Issues (14)
- Issues with loading from ESM, "type": "module", & rollup HOT 2
- 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
- Support for resolving modules from folder paths HOT 8
- Enabling usage of this package in an eslint plugin 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
- Support for TypeScript files HOT 13
- Use module.builtinModules instead of builtins dependency HOT 1
- how to resolve named exports? HOT 5
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.