Skip to content

feat: 支持依赖包里的 CSS 与字体(含 pnpm 的 .pnpm 布局) - #13

Merged
ikenxuan merged 1 commit into
mainfrom
feat/dep-css-fonts
Sep 16, 2026
Merged

ikenxuan merged 1 commit into
mainfrom
feat/dep-css-fonts

Conversation

@ikenxuan

Copy link
Copy Markdown
Contributor
  • CSS url() 的 / 开头引用按「CSS 同级目录(构建产物)→ assetsDir」依次解析, 依赖包带进来的字体(Vite 输出成 /assets/*)不再在 file:// 截图页静默回退
  • CSS 资源改按 assetsInlineLimit 落地:小文件内联为 data URI,大字体转 file://, 不再无条件 base64 进每一份 HTML;顺带处理百分号编码文件名与目录引用
  • dir.cssEntry / extraStylePaths 支持直接写包名,走 Node 解析(exports 映射、 pnpm 的 .pnpm 真实路径),不再依赖硬拼 node_modules/<包名>
  • createTemplateRenderer 透传 config.extraStylePaths(此前该项在约定流程里静默失效)
  • 独立运行包强制内联 CSS 资源:CSS 文本构建期烘死,file:// 绝对路径换机器即失效

- CSS url() 的 / 开头引用按「CSS 同级目录(构建产物)→ assetsDir」依次解析,
  依赖包带进来的字体(Vite 输出成 /assets/*)不再在 file:// 截图页静默回退
- CSS 资源改按 assetsInlineLimit 落地:小文件内联为 data URI,大字体转 file://,
  不再无条件 base64 进每一份 HTML;顺带处理百分号编码文件名与目录引用
- dir.cssEntry / extraStylePaths 支持直接写包名,走 Node 解析(exports 映射、
  pnpm 的 .pnpm 真实路径),不再依赖硬拼 node_modules/<包名>
- createTemplateRenderer 透传 config.extraStylePaths(此前该项在约定流程里静默失效)
- 独立运行包强制内联 CSS 资源:CSS 文本构建期烘死,file:// 绝对路径换机器即失效
@coderabbitai

coderabbitai Bot commented Sep 16, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 37f34e81-e02e-4eb4-b5a5-4670a404477f


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@pkg-pr-new

pkg-pr-new Bot commented Sep 16, 2026

Copy link
Copy Markdown

Open in StackBlitz

pnpm add https://pkg.pr.new/@karinjs/template-react@4bdf055

commit: 4bdf055

@ikenxuan
ikenxuan marked this pull request as ready for review September 16, 2026 05:35
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@ikenxuan
ikenxuan merged commit 708f41e into main Sep 16, 2026
4 checks passed
@ikenxuan
ikenxuan deleted the feat/dep-css-fonts branch September 16, 2026 05:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant