diff options
| author | Adam Soltys <[email protected]> | 2023-12-19 14:37:18 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2023-12-20 14:39:08 -0800 |
| commit | b67ca07bac3a0cb78f9b3c19a783c3253f06c29f (patch) | |
| tree | 1664d33bd1c514d016a7a1983af257197d4e5ac7 /loader.js | |
| parent | 337ca8c555f188d64c9f065972d443377adf042f (diff) | |
| download | coinos-server-b67ca07bac3a0cb78f9b3c19a783c3253f06c29f.tar.gz coinos-server-b67ca07bac3a0cb78f9b3c19a783c3253f06c29f.zip | |
biome
Diffstat (limited to 'loader.js')
| -rw-r--r-- | loader.js | 24 |
1 files changed, 12 insertions, 12 deletions
@@ -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); } |
