Przeglądaj źródła

fix(dashboard): Resolve file paths correctly on macOS

David Höck 10 miesięcy temu
rodzic
commit
3697c1471d

Plik diff jest za duży
+ 98 - 114
package-lock.json


+ 3 - 2
packages/dashboard/vite/vite-plugin-vendure-dashboard.ts

@@ -38,6 +38,7 @@ export function vendureDashboardPlugin(options: VitePluginVendureDashboardOption
     const packageRoot = getDashboardPackageRoot();
     const linguiConfigPath = path.join(packageRoot, 'lingui.config.js');
     process.env.LINGUI_CONFIG = linguiConfigPath;
+
     return [
         lingui(),
         TanStackRouterVite({ autoCodeSplitting: true }),
@@ -59,7 +60,7 @@ export function vendureDashboardPlugin(options: VitePluginVendureDashboardOption
  * Returns the path to the root of the `@vendure/dashboard` package.
  */
 function getDashboardPackageRoot(): string {
-    return path.join(import.meta.resolve('@vendure/dashboard'), '../..').replace(/file:[\/\\]+/, '');
+    return path.join(import.meta.resolve('@vendure/dashboard'), '../..').replace(/^file:\/+/, '/');
 }
 
 /**
@@ -67,5 +68,5 @@ function getDashboardPackageRoot(): string {
  */
 function getNormalizedVendureConfigPath(vendureConfigPath: string | URL): string {
     const stringPath = typeof vendureConfigPath === 'string' ? vendureConfigPath : vendureConfigPath.href;
-    return stringPath.replace(/^file:[\//]+/, '');
+    return stringPath.replace(/^file:[\//]+/, '/');
 }

Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików