@jsnw/srv-utils 1.0.8 → 1.0.9
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.
|
@@ -7,7 +7,7 @@ const zod_1 = require("zod");
|
|
|
7
7
|
const yaml_1 = require("yaml");
|
|
8
8
|
const file_exists_1 = require("../file-exists");
|
|
9
9
|
const getRootPackageDirname_1 = require("../getRootPackageDirname");
|
|
10
|
-
const PKG_ROOT_REGEX = /^%pkgroot[\/\\]/i;
|
|
10
|
+
const PKG_ROOT_REGEX = /^%pkgroot(?:[\/\\]|$)/i;
|
|
11
11
|
class ConfigLoader {
|
|
12
12
|
static _instance;
|
|
13
13
|
/**
|
|
@@ -134,7 +134,7 @@ class ConfigLoader {
|
|
|
134
134
|
resolvePkgRootPath(path) {
|
|
135
135
|
if (PKG_ROOT_REGEX.test(path))
|
|
136
136
|
path = path.replace(PKG_ROOT_REGEX, (0, getRootPackageDirname_1.getRootPackageDirnameSync)() + node_path_1.sep);
|
|
137
|
-
return path;
|
|
137
|
+
return (0, node_path_1.resolve)(path);
|
|
138
138
|
}
|
|
139
139
|
/**
|
|
140
140
|
* @param {string} fromDirname
|
|
@@ -143,7 +143,7 @@ class ConfigLoader {
|
|
|
143
143
|
* @private
|
|
144
144
|
*/
|
|
145
145
|
resolveIncludePath(fromDirname, toPath) {
|
|
146
|
-
return (0, node_path_1.resolve)(fromDirname, toPath);
|
|
146
|
+
return (0, node_path_1.resolve)(this.resolvePkgRootPath(fromDirname), toPath);
|
|
147
147
|
}
|
|
148
148
|
}
|
|
149
149
|
exports.ConfigLoader = ConfigLoader;
|
package/package.json
CHANGED