({
command = 'build',
mode = 'production',
env = {},
localRendererExists = true,
localToolboxExists = true,
}: {
command?: string;
mode?: string;
env?: Record<string, string | undefined>;
localRendererExists?: boolean;
localToolboxExists?: boolean;
} = {})
| 10 | } |
| 11 | |
| 12 | function makePolicy({ |
| 13 | command = 'build', |
| 14 | mode = 'production', |
| 15 | env = {}, |
| 16 | localRendererExists = true, |
| 17 | localToolboxExists = true, |
| 18 | }: { |
| 19 | command?: string; |
| 20 | mode?: string; |
| 21 | env?: Record<string, string | undefined>; |
| 22 | localRendererExists?: boolean; |
| 23 | localToolboxExists?: boolean; |
| 24 | } = {}) { |
| 25 | const localRendererPath = path.resolve(rootDir, '../../gsplat/webgpu/src'); |
| 26 | const localToolboxPath = path.resolve(rootDir, '../../gsplat/packages/gs-toolbox/ts/src/index.ts'); |
| 27 | const existingPaths = [ |
| 28 | localRendererExists ? localRendererPath : null, |
| 29 | localToolboxExists ? localToolboxPath : null, |
| 30 | ].filter((targetPath): targetPath is string => Boolean(targetPath)); |
| 31 | |
| 32 | return resolveViteLocalAliasPolicy({ |
| 33 | command, |
| 34 | mode, |
| 35 | env, |
| 36 | rootDir, |
| 37 | pathExists: makePathExists(existingPaths), |
| 38 | }); |
| 39 | } |
| 40 | |
| 41 | function slashPath(targetPath: string): string { |
| 42 | return targetPath.replaceAll('\\', '/'); |
no test coverage detected