Skip to content

LLM-Driven Extraction of Unstructured Data — Built for API Deployments & ETL Pipeline Workflows

[FIX] Fix Vite plugin to handle intra-plugin sibling imports (#1809)

vishnuszipstack3dee1c3a2ec1
diff --git a/frontend/vite.config.js b/frontend/vite.config.js
index 06d5cfd87..2ff54181e 100644
--- a/frontend/vite.config.js
+++ b/frontend/vite.config.js
@@ -15,13 +15,19 @@ function optionalPluginImports() {
return {
name: "optional-plugin-imports",
resolveId(source, importer) {
- if (!importer || !source.includes("plugins/")) return null;
+ if (!importer) return null;
- // Only handle relative imports that go through a plugins directory
+ // Only handle relative imports
if (!source.startsWith(".")) return null;
const resolved = path.resolve(path.dirname(importer), source);
+ // Only handle imports that resolve within a plugins directory.
+ // This covers both cross-plugin imports (e.g. "../plugins/foo")
+ // and intra-plugin sibling imports (e.g. "./TrialMessage" from
+ // within plugins/login-form/).
+ if (!resolved.includes("/plugins/")) return null;
+
// Check common extensions
const extensions = ["", ".js", ".jsx", ".ts", ".tsx"];
const exists = extensions.some(