We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 48ce083 commit 71dc042Copy full SHA for 71dc042
1 file changed
src/extensionPath.ts
@@ -1,10 +1,14 @@
1
-import { fileURLToPath } from "url";
2
-import path from "path";
+let CHROME_INSPECTOR_SYNC_EXTENSION_PATH: string | undefined;
3
4
-const __filename = fileURLToPath(import.meta.url);
5
-const __dirname = path.dirname(__filename);
+if (typeof window === "undefined") {
+ const u = "url";
+ const { fileURLToPath } = await import(u);
6
+ const p = "path";
7
+ const path = await import(p);
8
+ const __filename = fileURLToPath(import.meta.url);
9
+ const __dirname = path.dirname(__filename);
10
-export const CHROME_INSPECTOR_SYNC_EXTENSION_PATH = path.join(
- __dirname,
- "extension",
-);
11
+ CHROME_INSPECTOR_SYNC_EXTENSION_PATH = path.join(__dirname, "extension");
12
+}
13
+
14
+export { CHROME_INSPECTOR_SYNC_EXTENSION_PATH };
0 commit comments