We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 689217f + a65b1e1 commit 325505dCopy full SHA for 325505d
mod.ts
@@ -39,15 +39,16 @@ async function getAbsPath(
39
const aliases = await loadAliases();
40
const dirname = filename ? path.dirname(filename) : process.cwd();
41
42
- if (file.startsWith("/")) {
+ if (path.isAbsolute(file)) {
43
return file;
44
}
45
46
if (file.startsWith("./") || file.startsWith("../")) {
47
return path.resolve(dirname, file);
48
49
50
- for (const [alias, aliasPath] of Object.entries(aliases)) {
+ for (const [_alias, aliasPath] of Object.entries(aliases)) {
51
+ const alias = _alias.endsWith("/") ? _alias : `${_alias}/`;
52
if (file.startsWith(alias)) {
53
const s = new MagicString(file);
54
s.overwrite(0, alias.length, aliasPath);
0 commit comments