diff --git a/features/platform-admin/frontend-admin/vite.config.ts b/features/platform-admin/frontend-admin/vite.config.ts index 43757479b..3622ef60d 100755 --- a/features/platform-admin/frontend-admin/vite.config.ts +++ b/features/platform-admin/frontend-admin/vite.config.ts @@ -35,12 +35,19 @@ const attributesUrl = process.env.VITE_ATTRIBUTES_URL || getServiceUrl('attribut const imageGeneratorUrl = process.env.VITE_IMAGE_GENERATOR_URL || getServiceUrl('image-generator', 'api'); const semanticUrl = process.env.VITE_SEMANTIC_URL || getServiceUrl('truth-validation', 'api'); -// Rollup plugin to ignore .d.ts imports (fixes broken styled.d.ts in ui-* packages) +// Plugin to handle .d.ts imports (fixes broken styled.d.ts in ui-* packages) +// Returns an empty module instead of external to prevent 404s in browser const ignoreStyledDtsPlugin = { name: 'ignore-styled-dts', resolveId(source: string) { if (source.endsWith('.d.ts') || source === './styled.d.ts') { - return { id: source, external: true }; + return '\0virtual:empty-dts'; + } + return null; + }, + load(id: string) { + if (id === '\0virtual:empty-dts') { + return '// Empty module for .d.ts import'; } return null; }