arqex / arqex/amdrequire

Defining paths in config

Open
#3 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
31
Forks
4
PR merge metrics
No merged PRs in 30d

Description

It seems that one use-case (fairly common I would say) does not work. If you configure amdrequire with a path that is a common entry point to multiple modules, I don't see how this would work (actually doesn't). Consider this config option:
require.config({
basePath: __dirname + '/my/real/base',
paths: {
'common': 'libs/my/v1.0.0/debug'
}
});
then my require call would be something like this:
require(['common/js1', 'common/js2'], function(j1, j2){
....
}
});
My real dir structure looks like this:
__dirname/my/real/base/libs/my/v1.0.0/debug
|--js1.js
|--js2.js

How would you load js1 and js2?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the require.config paths and basePath entry points shown in the issue, then trace how amdrequire resolves common/js1 and common/js2. Use the provided directory layout as a reproduction case; done means both modules load from the configured common path.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
backend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.