docs: excludePages 说明补充#27
Conversation
WalkthroughThe README’s vite.config example is updated to import from node:url and add an absolute-path entry to excludePages via fileURLToPath(new URL(...)), retaining the existing glob pattern and adding a clarifying comment. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Possibly related PRs
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (2)
README.md (2)
268-268: Drop unnecessary URL import
URLis globally available in Node ESM; importing it is redundant. Keep onlyfileURLToPathto reduce noise.-import { fileURLToPath, URL } from 'node:url' +import { fileURLToPath } from 'node:url'
278-280: Clarify single-file vs glob usage and capitalize HBuilderX consistentlyShowing both a relative single-file path and an absolute path together can confuse readers. Recommend keeping the glob for general cases and the absolute path for HBuilderX single-file cases, with explicit comments. Also use “HBuilderX” (not “hbx”) for consistency.
Please verify this renders clearly for both CLI and HBuilderX readers:
excludePages: [ - 'src/exclude.vue', - 'src/exclude/**/*.vue', - // 在 hbx 项目中指定具体文件时,你可能需要写绝对路径 - fileURLToPath(new URL('src/exclude.vue', import.meta.url)), + // CLI:使用相对路径的 glob(推荐) + 'src/exclude/**/*.vue', + // HBuilderX:指定“单个文件”时建议使用绝对路径 + fileURLToPath(new URL('./src/exclude.vue', import.meta.url)), ],
- Sanity-check on Windows paths: ensure the plugin normalizes absolute paths before matching. If not, we may want to add a brief note that forward slashes are expected in globs while absolute paths come from
fileURLToPath.
|
谢谢 |
|
resolved c8f812d TAHNKS ❤ |
我在 hbx 项目中指定具体文件时,使用文件相对路径不起作用,补充绝对路径使用方式
Summary by CodeRabbit