-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathpaths.ts
More file actions
35 lines (30 loc) · 829 Bytes
/
paths.ts
File metadata and controls
35 lines (30 loc) · 829 Bytes
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
26
27
28
29
30
31
32
33
34
35
import { createRequire } from 'node:module';
import path from 'node:path';
export const reactRefreshPath = path.join(
import.meta.dirname,
'../client/reactRefresh.js',
);
export const reactRefreshEntryPath = path.join(
import.meta.dirname,
'../client/reactRefreshEntry.js',
);
export const refreshUtilsPath = path.join(
import.meta.dirname,
'../client/refreshUtils.js',
);
const require = createRequire(import.meta.url);
let refreshRuntimeDirPath: string;
export function getRefreshRuntimeDirPath() {
if (!refreshRuntimeDirPath) {
refreshRuntimeDirPath = path.dirname(
require.resolve('react-refresh/runtime'),
);
}
return refreshRuntimeDirPath;
}
export const getRefreshRuntimePaths = () => [
reactRefreshEntryPath,
reactRefreshPath,
refreshUtilsPath,
getRefreshRuntimeDirPath(),
];