Tracking: Vite doesn't resolve `#lib` in CSS `url()` (blocks `#lib` in `<style>` tags)

Abierto
#1,461 2 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 4 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
35/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
typescript, vite
Área
cli, tooling

Línea de trabajo

Read packages/sv/src/migrate/migrations/sveltekit-3/tasks/lib-alias.ts and the linked Vite issue first; this follow-up is blocked until Vite supports subpath imports in CSS url(). Once that support ships, inspect the migration tests and verify that #lib paths inside <style> tags are handled consistently with other paths.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

pkg:migrate

When Vite supports subpath imports in CSS url(), we should revisit the workaround from the Kit 3 migration.

Context
  • Root cause is upstream: vitejs/vite#16155 — Vite does not resolve #-prefixed subpath imports (e.g. #lib/...) in CSS url(). It is approved, labeled p3-downstream-blocker, and on the Vite 8.4 milestone.
  • This first surfaced in #1267: the migration's $lib → #lib change broke url("$lib/...") inside <style> tags.
  • Workaround (PR #1266): inside <style> tags, lib-alias.ts rewrites $lib to a relative path instead of #lib.
Impact
  • Path shape is inconsistent: #lib/... everywhere else, relative path inside <style> tags.
  • Users who hand-write url("#lib/...") are still broken until Vite fixes it.
Follow-up (once Vite 8.4 ships support)
  • Revisit lib-alias.ts and consider emitting #lib inside <style> tags so usage is consistent.
    (The back-references use full GitHub issue shorthand so they resolve when posted via gh.)
Lenguaje dominante
TypeScript
Estrellas
513
Forks
110
Merge medio
5 d 1 h
PR fusionados (30 d)
24

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de sveltejs/cli

Todos los issues de sveltejs/cli

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.