Skip to content
This repository was archived by the owner on Feb 28, 2026. It is now read-only.

Commit c5495fb

Browse files
committed
Normalize paths for windows
1 parent 01f6371 commit c5495fb

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

packages/player/src/services/plugins/pluginCompiler.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ export async function compilePlugin(
168168

169169
// Keep a neutral working directory. Real resolution happens inside our
170170
// virtual "tauri-fs" plugin (below).
171-
absWorkingDir: '/',
171+
absWorkingDir: entryDir,
172172

173173
// Inline tsconfig so esbuild doesn't try to read tsconfig.json from disk.
174174
tsconfigRaw: { compilerOptions: {} },
@@ -190,13 +190,19 @@ export async function compilePlugin(
190190
// 1) The entry point itself.
191191
// Tag it with our namespace to keep it in the virtual fs flow.
192192
if (args.kind === 'entry-point') {
193-
return { path: args.path, namespace: 'tauri-fs' };
193+
return {
194+
path: toForwardSlashes(args.path),
195+
namespace: 'tauri-fs',
196+
};
194197
}
195198

196199
// 2) Absolute paths like "/Users/…/index.ts" or "C:\Users\…\index.ts".
197200
// Keep the absolute path as-is, just force the namespace.
198201
if (await isAbsolute(args.path)) {
199-
return { path: args.path, namespace: 'tauri-fs' };
202+
return {
203+
path: toForwardSlashes(args.path),
204+
namespace: 'tauri-fs',
205+
};
200206
}
201207

202208
// 3) Relative paths like "./foo" or "../bar".
@@ -223,7 +229,7 @@ export async function compilePlugin(
223229
{ filter: /.*/, namespace: 'tauri-fs' },
224230
async (args) => {
225231
// Special-case the entry file: we already have its contents and loader.
226-
if (args.path === entryPath) {
232+
if (toForwardSlashes(args.path) === entryPath) {
227233
const thisDir = entryDir;
228234
return {
229235
contents: entrySource,

0 commit comments

Comments
 (0)