Allow prefixes for packages
- Dominant language
- JavaScript
- Stars
- 402
- Forks
- 134
- PR merge metrics
- No merged PRs in 30d
Description
**I'm submitting a feature request**
**Please tell us about your environment:**
* **Browser:**
all
* **Language:**
all
* **Loader/bundler:**
CLI
**Feature:**
Allow configuration of prefixed module names, similar to the way JSPM handles different registries.
I would like to migrate my application from JSPM/SystemJS to the CLI. I am using prefixed module names, such as `app:main`. The following is the relevant configuration:
```js
SystemJS.config({
paths: {
"app:": "dist/app/",
"nav:": "dist/nav/",
"env:": "dist/env/",
"lib:": "dist/lib/"
},
packages: {
".": {},
},
packageConfigPaths: [
"lib:*/config.json",
],
});
```
**What is the motivation / use case for changing the behavior?**
I've split my application into multiple segments to better isolate different components and code with different code. E.g. modules in the `env` segment handle managing the environment of my app (what servers to connect to, the logged in user, the user's credentials, etc); content for my app itself is in the `app` segment.
Unprefixed module name reduce code clarity. Using prefixed module names, I immediately know if a given import refers to my code or a 3rd party dependency, and if it's the former, I also immediately have a general idea of the purpose of the imported code.
Contributor guide
Research direction
The issue provides no repository file or test entry point; begin by locating the CLI's package and module-resolution configuration, then compare its behavior with the supplied SystemJS paths and packages example. Done means the CLI can configure prefixed names such as app:main and resolve the requested segmented modules without reducing their prefixes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- build-system, cli
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100