-
Notifications
You must be signed in to change notification settings - Fork 154
/
url.ts
executable file
·25 lines (21 loc) · 934 Bytes
/
url.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import { resolve } from "path";
export const panelUrlDev = `http://localhost:${process.env.DEV_PANEL_PORT ?? 3330}`;
export const settingsUrlDev = `http://localhost:${process.env.DEV_SETTINGS_PORT ?? 3331}`;
export const panelUrlProd = `file://${resolve(__dirname, "../index.html")}`;
export const settingsUrlProd = `file://${resolve(__dirname, "../settings.html")}`;
export const preloadMainScriptPathDev = `${resolve(
process.cwd(),
"dist/renderer",
"loadMainContent.js",
)}`;
export const preloadMainScriptPathProd = `${resolve(
__dirname,
"..",
"renderer",
"loadMainContent.js",
)}`;
export const preloadScriptPathDev = `${resolve(process.cwd(), "dist/renderer", "loadContent.js")}`;
export const preloadScriptPathProd = `${resolve(__dirname, "..", "renderer", "loadContent.js")}`;
export const isFigmaValidUrl = (url: string): boolean => {
return /^(figma:\/\/|https?:\/\/w{0,3}?\.?figma\.com)/.test(url);
};