CodeForAfrica / CodeForAfrica/ui
@/CivicSignalBlog - Implicit imports not working for Subpath Import Aliases
- Dominant language
- JavaScript
- Stars
- 3
- Forks
- 2
- Avg merge
- 3d 1h
- Merged PRs (30d)
- 5
Description
As described in PR #902
This is a minor issue and shouldn't be a blocker, but it would be nice to address, so it’s worth exploring.
After switching to [Subpath Import Aliases](https://nodejs.org/api/packages.html#subpath-imports), we are currently required to explicitly include the filename in all our imports, even when an `index.js` file is present. As a result, you may encounter imports like:
```
import slug from "#civicsignalblog/payload/fields/slug/index";
```
Instead of
```
import slug from "#civicsignalblog/payload/fields/slug";
```
It would be much better if we can find a clean and reusable way to automatically resolve `index.js` file from our import paths.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.