diff --git a/react/src/components/LoginView.tsx b/react/src/components/LoginView.tsx index 6b8df43385..35b6e26433 100644 --- a/react/src/components/LoginView.tsx +++ b/react/src/components/LoginView.tsx @@ -190,7 +190,11 @@ const LoginView: React.FC<{ if (!sanitizedPlugin || sanitizedPlugin !== loginPlugin) return; import( - /* webpackIgnore: true */ + // `@vite-ignore` = Vite's equivalent of webpack's `webpackIgnore`. + // The path interpolates a user-config'd plugin name at runtime and + // sits OUTSIDE react/src — Vite would otherwise warn about the + // un-analyzable specifier on every dev rebuild. + /* @vite-ignore */ `../../../src/plugins/${sanitizedPlugin}` ).catch(() => { setLoginError({ message: t('error.LoginFailed') }); diff --git a/react/src/components/PluginLoader.tsx b/react/src/components/PluginLoader.tsx index a4ceac62b5..754c366938 100644 --- a/react/src/components/PluginLoader.tsx +++ b/react/src/components/PluginLoader.tsx @@ -107,7 +107,10 @@ function PluginLoader() { : `/dist/plugins/${sanitizedPage}.js`; try { - await import(/* webpackIgnore: true */ pluginUrl); + // `@vite-ignore` = Vite's equivalent of webpack's `webpackIgnore`. + // pluginUrl is a runtime-computed path outside the module graph, + // so we opt out of static analysis entirely. + await import(/* @vite-ignore */ pluginUrl); const pageItem = document.createElement(page) as PluginPageElement; pageItem.classList.add('page');