mirror of
https://github.com/transformerlab/transformerlab-app.git
synced 2025-04-14 07:48:20 +03:00
14 lines
436 B
TypeScript
14 lines
436 B
TypeScript
/* eslint import/prefer-default-export: off */
|
|
import { URL } from 'url';
|
|
import path from 'path';
|
|
|
|
export function resolveHtmlPath(htmlFileName: string) {
|
|
if (process.env.NODE_ENV === 'development') {
|
|
const port = process.env.PORT || 1212;
|
|
const url = new URL(`http://localhost:${port}`);
|
|
url.pathname = htmlFileName;
|
|
return url.href;
|
|
}
|
|
return `file://${path.resolve(__dirname, '../renderer/', htmlFileName)}`;
|
|
}
|