-
Notifications
You must be signed in to change notification settings - Fork 276
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: added Vitepress packaging to FAQ section #2776
base: dev
Are you sure you want to change the base?
Conversation
Warning Rate limit exceeded@James-9696 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 27 minutes and 14 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (2)
WalkthroughThis pull request adds documentation to the FAQ sections in both English and Chinese markdown files, addressing a specific issue with VitePress and the Opentiny component package. The new content explains a build error ( Changes
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
WalkthroughThis pull request adds solutions to common problems encountered when using Vitepress with the Opentiny component package. It provides a specific solution to the error Changes
|
|
||
_Reason:_ Using Vitepress packaging, the suffix paths such as js/css related to file references in the component package cannot be found. Causing error: ERR_UNSUPPORTED_DIR_IMPORT | ||
|
||
_Solution:_ Resolve the error issue by configuring the 'vitepress/config. js' file: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensure that the vitepress/config.js
file is correctly configured to handle external dependencies, as this is crucial for resolving the ERR_UNSUPPORTED_DIR_IMPORT
error.
|
||
_原因:_ 使用vitepress打包,找不到组件包内文件相关引用的js/css等后缀路径。导致报错:ERR_UNSUPPORTED_DIR_IMPORT | ||
|
||
_解决方案:_ 通过配置`vitepress/config.js`文件,解决报错问题: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
确保 vitepress/config.js
文件正确配置以处理外部依赖关系,这对于解决 ERR_UNSUPPORTED_DIR_IMPORT
错误至关重要。
[e2e-test-warn] The title of the Pull request should look like "fix(vue-renderless): [action-menu, alert] fix xxx bug". Please make sure you've read our contributing guide |
There was a problem hiding this 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 (4)
examples/sites/demos/pc/webdoc/faq.md (1)
20-21
: Improve section title formattingThe section title uses a Chinese comma (、) which is inconsistent with the English version. Consider standardizing the punctuation across both versions.
-## 2、在vitepress中,引用opentiny组件包,使用vitepress打包命令:pnpm docs:build,报错:ERR_UNSUPPORTED_DIR_IMPORT +## 2. 在vitepress中,引用opentiny组件包,使用vitepress打包命令:pnpm docs:build,报错:ERR_UNSUPPORTED_DIR_IMPORTexamples/sites/demos/pc/webdoc/faq-en.md (3)
20-21
: Fix punctuation and formatting in English titleThe section title uses Chinese punctuation marks (、) and inconsistent spacing around punctuation.
-## 2、In Vitepress, reference the Opentiny component package and use Vitepress to package the command: pnpm docs:build, report errors: ERR_UNSUPPORTED_DIR_IMPORT +## 2. In VitePress, when using Opentiny component package with `pnpm docs:build`, error: ERR_UNSUPPORTED_DIR_IMPORT
22-23
: Fix Chinese punctuation marks in English textThe text uses Chinese punctuation marks (:) instead of English colons (:).
-_Reason:_ Using Vitepress packaging, the suffix paths such as js/css related to file references in the component package cannot be found. Causing error: ERR_UNSUPPORTED_DIR_IMPORT +_Reason:_ Using VitePress packaging, the suffix paths (js/css) related to file references in the component package cannot be found, causing error: ERR_UNSUPPORTED_DIR_IMPORT
24-25
: Fix formatting and punctuationThe text uses Chinese punctuation and inconsistent product name casing.
-_Solution:_ Resolve the error issue by configuring the 'vitepress/config. js' file: +_Solution:_ Resolve the error by configuring the `vitepress/config.js` file:
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
examples/sites/demos/pc/webdoc/faq-en.md
(1 hunks)examples/sites/demos/pc/webdoc/faq.md
(1 hunks)
🔇 Additional comments (1)
examples/sites/demos/pc/webdoc/faq.md (1)
26-34
: Verify the VitePress configuration solutionThe solution looks technically correct. However, let's verify if this is the minimal configuration needed and if there are any version-specific requirements.
✅ Verification successful
Configuration is correct and minimal ✅
The VitePress configuration is the minimal required solution to resolve the
ERR_UNSUPPORTED_DIR_IMPORT
error when using OpenTiny components. ThenoExternal: [/@opentiny\//]
setting specifically targets only OpenTiny packages during SSR builds, without adding any unnecessary configuration.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Search for similar VitePress configurations in the codebase rg -g '*.js' -g '*.ts' 'noExternal.*opentiny' # Check if there are any VitePress config files that might need this update fd -e js -e ts 'vitepress.config' -x echo "Found config file: {}"Length of output: 113
Script:
#!/bin/bash # Search for any Vite or VitePress config files fd -e js -e ts -e mjs '(vite\.config|\.vitepress.+config)' -x echo "Found config: {}" # Search for noExternal configurations rg -g '*.{js,ts,md}' 'noExternal' -A 2 -B 2 # Search for VitePress documentation or examples fd -g 'README*.md' -x rg -l 'vitepress'Length of output: 1484
Script:
#!/bin/bash # Check package.json files for VitePress dependencies fd package.json -x rg -l "vitepress" # Check the full context of the FAQ files cat examples/sites/demos/pc/webdoc/faq.md cat examples/sites/demos/pc/webdoc/faq-en.md # Look for any SSR-related configuration or documentation rg -g '*.{md,js,ts}' -l 'ssr.*config'Length of output: 2249
PR
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
Add solutions to common problems
What is the current behavior?
Issue Number: N/A
#2684
What is the new behavior?
Does this PR introduce a breaking change?
Other information
Summary by CodeRabbit
ERR_UNSUPPORTED_DIR_IMPORT
error by configuringnoExternal
in VitePress settings