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

オープン
#1,461 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 4 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
typescript, vite
領域
cli, tooling

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.)
主要言語
TypeScript
スター
513
フォーク
110
平均マージ
5日 1時間
マージ済み PR(30日)
24

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

sveltejs/cli のほかの issue

sveltejs/cli の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。