Skip to content

Commit

Permalink
test relative paths
Browse files Browse the repository at this point in the history
  • Loading branch information
manuel-serrano committed Apr 24, 2024
1 parent 7ce284f commit e1118d2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions lib/hiphop-loader.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/* ------------------------------------------------------------- */
/* Author : Manuel Serrano */
/* Creation : Fri Nov 17 08:15:59 2023 */
/* Last change : Wed Apr 24 14:25:54 2024 (serrano) */
/* Last change : Wed Apr 24 14:35:54 2024 (serrano) */
/* Copyright : 2023-24 Manuel Serrano */
/* ------------------------------------------------------------- */
/* HipHop loader/resolver loaders. */
Expand Down Expand Up @@ -41,13 +41,14 @@ export async function resolve(url, context, nextResolve) {
} else if (url === "@hop/hiphop" && process.env.HIPHOP_RESOLVE) {
return {
shortCircuit: true,
url: "file://" + normalize(process.cwd() + "/" + process.env.HIPHOP_RESOLVE)
url: "file://" + normalize(process.cwd() + "/"
+ process.env.HIPHOP_RESOLVE + "/lib/hiphop.js")
}
} else if (url.match("@hop/hiphop/") && process.env.HIPHOP_RESOLVE) {
} else if (url.match("@hop/hiphop/modules") && process.env.HIPHOP_RESOLVE) {
return {
shortCircuit: true,
url: "file://" + normalize(process.cwd() + "/" +
url.replace("@hop/hiphop/", process.env.HIPHOP_RESOLVE + "/"))
url.replace("@hop/hiphop/", process.env.HIPHOP_RESOLVE + "/modules/"))
}
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"mocha": "^10.2.0"
},
"scripts": {
"test": "HIPHOP_RESOLVE=\"./lib/hiphop.js\" NODE_OPTIONS=\"--enable-source-maps --no-warnings --loader ./lib/hiphop-loader.mjs\" mocha --exit test/**/*.test.js",
"test": "HIPHOP_RESOLVE=\".\" NODE_OPTIONS=\"--enable-source-maps --no-warnings --loader ./lib/hiphop-loader.mjs\" mocha --exit test/**/*.test.js",
"prepare": "node etc/configure.js package.json lib/config.js.in lib/config.js && node etc/buildmodules.js"
}
}

0 comments on commit e1118d2

Please sign in to comment.