Skip to content

Commit

Permalink
fix(babel-utils): improve website compatability
Browse files Browse the repository at this point in the history
  • Loading branch information
DylanPiercey committed Jan 25, 2021
1 parent d67bac5 commit c122c08
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions packages/babel-utils/src/imports.js
@@ -1,24 +1,24 @@
import path from "path";
import { types as t } from "@marko/babel-types";

const IS_POSIX = path.sep === "/";
const IMPORTS_KEY = Symbol();
const FS_ROOT_DIR = path.parse(process.cwd()).root;
const FS_START = IS_POSIX ? path.sep : /^(.*?:)/.exec(process.cwd())[1];

const toPosix =
path.sep === "/"
? v => v
: v => {
let result = "";
for (let i = v.length; i--; ) {
const c = v[i];
result = (c === path.sep ? "/" : c) + result;
}
const toPosix = IS_POSIX
? v => v
: v => {
let result = "";
for (let i = v.length; i--; ) {
const c = v[i];
result = (c === path.sep ? "/" : c) + result;
}

return result;
};
return result;
};

export function resolveRelativePath(file, request) {
if (!request.startsWith(FS_ROOT_DIR)) {
if (!request.startsWith(FS_START)) {
return remapProductionMarkoBuild(file, request);
}

Expand Down

0 comments on commit c122c08

Please sign in to comment.