From b67ca07bac3a0cb78f9b3c19a783c3253f06c29f Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Tue, 19 Dec 2023 14:37:18 -0800 Subject: biome --- loader.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'loader.js') diff --git a/loader.js b/loader.js index e8f5036e..b15c5d6e 100644 --- a/loader.js +++ b/loader.js @@ -1,22 +1,22 @@ -import path from 'path' -import fs from 'fs' +import path from "path"; +import fs from "fs"; -export function resolve (specifier, context, nextResolve) { +export function resolve(specifier, context, nextResolve) { const { parentURL = null } = context; - if (specifier.startsWith('$')) { - if (specifier.startsWith('$config')) { - specifier = 'file://' + path.resolve('.') + "/config.js"; - } - else if (specifier.startsWith('$')) { - specifier = specifier.replace(/^\$/, 'file://' + path.resolve('.') + '/') + '.js'; + if (specifier.startsWith("$")) { + if (specifier.startsWith("$config")) { + specifier = "file://" + path.resolve(".") + "/config.js"; + } else if (specifier.startsWith("$")) { + specifier = + specifier.replace(/^\$/, "file://" + path.resolve(".") + "/") + ".js"; } return { shortCircuit: true, - url: new URL(specifier).href + url: new URL(specifier).href, }; - } + } - return nextResolve(specifier, context) + return nextResolve(specifier, context); } -- cgit v1.2.3