Skip to content

docs: excludePages 说明补充#27

Closed
cnguu wants to merge 1 commit into
uni-ku:mainfrom
cnguu:docs/excludePages
Closed

docs: excludePages 说明补充#27
cnguu wants to merge 1 commit into
uni-ku:mainfrom
cnguu:docs/excludePages

Conversation

@cnguu
Copy link
Copy Markdown
Contributor

@cnguu cnguu commented Sep 22, 2025

我在 hbx 项目中指定具体文件时,使用文件相对路径不起作用,补充绝对路径使用方式

Summary by CodeRabbit

  • Documentation
    • Updated README vite.config example to include an import from node:url and demonstrate using fileURLToPath to resolve an absolute path in excludePages.
    • Added a note clarifying when absolute paths may be required in certain projects.
    • Retained the existing glob pattern for exclusions, with minor formatting adjustments for clarity.

@cnguu cnguu requested a review from skiyee as a code owner September 22, 2025 03:45
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Sep 22, 2025

Walkthrough

The 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

Cohort / File(s) Change Summary
Docs: README update
README.md
Updated vite.config example: added import from node:url; appended absolute-path excludePages entry using fileURLToPath(new URL('src/exclude.vue', import.meta.url)); retained existing 'src/exclude/**/*.vue' pattern; added comment noting absolute path requirement; minor trailing comma adjustment.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

Poem

I thump my paws on docs so neat,
A trail of paths—absolute, complete.
With fileURLToPath I hop,
From URL to disk I plop.
Excludes aligned, the build won’t stew—
README nibbled, configs chew! 🥕

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed 标题 "docs: excludePages 说明补充" 简短明确,直接表明这是对 excludePages 文档的补充,与 PR 中在 README 示例中增加绝对路径示例的主要改动一致。标题没有冗余噪声,能让审阅者快速理解变更意图。
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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 and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (2)
README.md (2)

268-268: Drop unnecessary URL import

URL is globally available in Node ESM; importing it is redundant. Keep only fileURLToPath to reduce noise.

-import { fileURLToPath, URL } from 'node:url'
+import { fileURLToPath } from 'node:url'

278-280: Clarify single-file vs glob usage and capitalize HBuilderX consistently

Showing 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.
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a6389a9 and c6f130e.

📒 Files selected for processing (1)
  • README.md (2 hunks)

@skiyee
Copy link
Copy Markdown
Member

skiyee commented Sep 22, 2025

谢谢
我将尝试从根源上解决这个问题,以保证该属性在不同的IDE中有着相同的行为。

@skiyee
Copy link
Copy Markdown
Member

skiyee commented Sep 22, 2025

resolved c8f812d

TAHNKS ❤

@skiyee skiyee closed this Sep 22, 2025
@cnguu cnguu deleted the docs/excludePages branch September 22, 2025 06:16
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.

2 participants