mirror of
https://github.com/marko-js/marko.git
synced 2025-12-08 19:26:05 +00:00
fix(babel-utils): resolve node_module templates to relative paths (#1645)
This commit is contained in:
parent
0c6e968b4e
commit
db4232e1e2
@ -2,6 +2,7 @@ import path from "path";
|
||||
import { types as t } from "@marko/babel-types";
|
||||
|
||||
const IMPORTS_KEY = Symbol();
|
||||
const FS_ROOT_DIR = path.parse(process.cwd()).root;
|
||||
|
||||
const toPosix =
|
||||
path.sep === "/"
|
||||
@ -17,7 +18,7 @@ const toPosix =
|
||||
};
|
||||
|
||||
export function resolveRelativePath(file, request) {
|
||||
if (request[0] === ".") {
|
||||
if (!request.startsWith(FS_ROOT_DIR)) {
|
||||
return request;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user