Skip to content

Commit

Permalink
Remove duplicate slash in browser dynamic imports on mac/ubuntu (#361)
Browse files Browse the repository at this point in the history
TEST=manual
J=None

tested that dynamic imports work on both windows and mac

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
oshi97 and github-actions[bot] authored Aug 31, 2023
1 parent 8b57ea5 commit 508fec9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/studio/src/utils/dynamicImportFromBrowser.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import path from "path-browserify";

/* eslint-disable @typescript-eslint/no-explicit-any */
/**
* In order to support dynamic imports from the browser on Windows,
Expand All @@ -8,5 +10,6 @@
export default function dynamicImportFromBrowser(
absFilepath: string
): Promise<any> {
return import(/* @vite-ignore */ "/@fs/" + absFilepath);
const importPath = path.join("/@fs", absFilepath);
return import(/* @vite-ignore */ importPath);
}

0 comments on commit 508fec9

Please sign in to comment.