binhend 2.2.11 → 2.2.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -53,17 +53,15 @@ Module._resolveFilename = function (request, parent, isMain, options) {
|
|
|
53
53
|
if (!request.startsWith(alias)) continue;
|
|
54
54
|
// Loop through the array of resolved paths for this alias
|
|
55
55
|
for (const resolvedPath of aliasMap[alias]) {
|
|
56
|
-
// Construct
|
|
57
|
-
var newRequest;
|
|
56
|
+
// Construct a new request path (convert @ path to resolved path)
|
|
57
|
+
var newRequest = request.replace(alias, resolvedPath);
|
|
58
58
|
|
|
59
|
+
// Check if the above resolved path matching web component path, then change from source directory to module directory
|
|
59
60
|
if (parent.filename.startsWith(settings.webModulePath)) {
|
|
60
61
|
// BINHEND web components (formatted code) load each others in build-time still requiring src paths (src file paths), not module paths (formatted file paths)
|
|
61
62
|
// parent.filename is the file location of module which makes this request by calling require()
|
|
62
63
|
newRequest = newRequest.replace(settings.webSourcePath, settings.webModulePath);
|
|
63
64
|
}
|
|
64
|
-
else {
|
|
65
|
-
newRequest = request.replace(alias, resolvedPath);
|
|
66
|
-
}
|
|
67
65
|
|
|
68
66
|
// Attempt to resolve the new request
|
|
69
67
|
try {
|