From 16863fd2091c33cc68ef6b084b719bdd6b2ae910 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Thu, 7 Aug 2025 15:43:27 -0500 Subject: [PATCH] Restore lightningFsPlugin --- src/lib/build/lightningFsPlugin.ts | 37 ++++++++---------------------- 1 file changed, 10 insertions(+), 27 deletions(-) diff --git a/src/lib/build/lightningFsPlugin.ts b/src/lib/build/lightningFsPlugin.ts index 778390ae..366ec1cd 100644 --- a/src/lib/build/lightningFsPlugin.ts +++ b/src/lib/build/lightningFsPlugin.ts @@ -11,18 +11,11 @@ export function lightningFsPlugin(fs: JSRuntimeFS, cwd: string): Plugin { let resolved: string; if (args.path.startsWith('@/')) { - // Handle alias paths resolved = path.join(cwd, args.path.slice(2)); } else if (args.path.startsWith('/')) { - // Handle absolute paths resolved = args.path; - } else if (args.importer) { - // Handle relative imports - use the directory of the importing file - const importerDir = path.dirname(args.importer); - resolved = path.join(importerDir, args.path); } else { - // Initial entry point or fallback to resolveDir - resolved = path.join(cwd, args.resolveDir || '', args.path); + resolved = path.join(cwd, args.resolveDir, args.path); } try { @@ -47,8 +40,6 @@ export function lightningFsPlugin(fs: JSRuntimeFS, cwd: string): Plugin { return { contents: await fs.readFile(args.path, 'utf8'), loader: ext as Loader, - // Set resolveDir for subsequent imports from this file - resolveDir: path.dirname(args.path), }; }); }, @@ -59,24 +50,18 @@ async function tryFileVariants(fs: JSRuntimeFS, basePath: string): Promise