barhun / extensionless Goto Github PK
View Code? Open in Web Editor NEWNode.js loader for import specifiers as file paths without extensions or as directory paths
License: MIT License
Node.js loader for import specifiers as file paths without extensions or as directory paths
License: MIT License
As node 20 dropped the ball by removing the "experimental-specifier-resolution" flag, my swc setup won't work anymore. Then I found this library in stack overflow, and it completely solves the problem. Thank you so much!
This might be my missing link to actually adopt ESM, so thank you for that.
I'm wondering if you think it's possible to also handle library imports. Something like
import { isPlainObject } from '@nestjs/common/utils/shared.utils';
Adding the extension to that import fixes it.
Maybe that's harder though logically, because there's package.json exports
to consider. Or some other complication with non-local code?
Hi barhun. Thank you so much for your work and this library.
I gave it a try on my project and got some issues using it without modifications, since i had import alias managed inside my package.json.
I forked your lib and created this alternative : www.npmjs.com/package/specifier-resolution-node
Would you have some time to review it and give me feedback about its stability ? I saw you added some code to make it works with windows, and i couldn't test it since i'm on Linux.
Anyway thank you for your work which was a good base for my solution :)
Thanks for this very useful module.
My issue:
It works for the file articleRouter.ts
but not for article.router.ts
.
I think you should reenforce the pattern where you add the js extension or not.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.