app-bundler 0.0.99 → 0.1.0
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/lib/bundler.js +6 -2
- package/lib/cli.js +6 -2
- package/package.json +1 -1
package/lib/bundler.js
CHANGED
|
@@ -530,8 +530,12 @@ function path_isRelative(path) {
|
|
|
530
530
|
exports.path_isRelative = path_isRelative;
|
|
531
531
|
;
|
|
532
532
|
function path_toRelative(path, anchor, base) {
|
|
533
|
-
var
|
|
534
|
-
|
|
533
|
+
var pathNormalized = path_normalize(path);
|
|
534
|
+
var anchorNormalized = path_normalize(anchor);
|
|
535
|
+
var path_ = path_resolveUrl(pathNormalized, base);
|
|
536
|
+
var absolute_ = path_resolveUrl(anchorNormalized, base);
|
|
537
|
+
if (pathNormalized.includes(anchorNormalized) === false && path_getExtension(absolute_) !== '') {
|
|
538
|
+
// in-case anchor is a File
|
|
535
539
|
absolute_ = path_getDir(absolute_);
|
|
536
540
|
}
|
|
537
541
|
absolute_ = path_combine(absolute_, '/');
|
package/lib/cli.js
CHANGED
|
@@ -532,8 +532,12 @@ function path_isRelative(path) {
|
|
|
532
532
|
exports.path_isRelative = path_isRelative;
|
|
533
533
|
;
|
|
534
534
|
function path_toRelative(path, anchor, base) {
|
|
535
|
-
var
|
|
536
|
-
|
|
535
|
+
var pathNormalized = path_normalize(path);
|
|
536
|
+
var anchorNormalized = path_normalize(anchor);
|
|
537
|
+
var path_ = path_resolveUrl(pathNormalized, base);
|
|
538
|
+
var absolute_ = path_resolveUrl(anchorNormalized, base);
|
|
539
|
+
if (pathNormalized.includes(anchorNormalized) === false && path_getExtension(absolute_) !== '') {
|
|
540
|
+
// in-case anchor is a File
|
|
537
541
|
absolute_ = path_getDir(absolute_);
|
|
538
542
|
}
|
|
539
543
|
absolute_ = path_combine(absolute_, '/');
|