Skip to content

fix: 添加 @vusion/utils 的路径别名#360

Merged
YufJi merged 1 commit into
testfrom
bugfix/vue2-alias
May 12, 2026
Merged

fix: 添加 @vusion/utils 的路径别名#360
YufJi merged 1 commit into
testfrom
bugfix/vue2-alias

Conversation

@YufJi
Copy link
Copy Markdown
Collaborator

@YufJi YufJi commented May 12, 2026

Summary by CodeRabbit

发布说明

  • Chores
    • 更新了构建配置,优化了模块解析路径

Review Change Stack

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 12, 2026

概览

Vue 2 项目的 Webpack 配置中添加了一个模块别名,将 @vusion/utils 映射到本地的 src/utils 目录。此更改确保 @vusion/utils 导入能够正确解析到项目内的本地实现。

变更内容

Webpack 别名配置

图层 / 文件 摘要
@vusion/utils 别名映射
packages/vue2/source/vue.config.js
configureWebpack 中添加 resolve.alias 条目,将 @vusion/utils 别名映射到本地 src/utils 目录路径,前面附加了说明源库兼容性的注释。

代码审查工作量评估

🎯 1 (平凡) | ⏱️ ~3 分钟

建议的审查者

  • buke-dev

诗歌

🐰 一条别名添了清,
工具库路径更精明,
Webpack 引指本地源,
模块解析不迷津。
✨🔗

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed PR标题清晰准确地概括了主要变更:为 @vusion/utils 添加 Webpack 路径别名,与代码更改内容完全相符。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch bugfix/vue2-alias

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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
Contributor

@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: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/vue2/source/vue.config.js`:
- Line 10: The new alias assignment uses single quotes and conflicts with the
file's double-quote style; update the statement that sets
config.resolve.alias['@vusion/utils'] to use double quotes consistently (i.e.,
change the key and path strings to double quotes), then run Prettier (or your
project's format script) to reformat the file so it matches the project's
Prettier rules for JS/JSON files.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: ed74b498-0d93-4ca3-9cb5-b3d3382d0ef9

📥 Commits

Reviewing files that changed from the base of the PR and between dd31410 and cac0cef.

📒 Files selected for processing (1)
  • packages/vue2/source/vue.config.js

config.devtool = false;
}
// 兼容源码中library里使用的别名
config.resolve.alias['@vusion/utils'] = path.resolve(__dirname, 'src/utils');
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

请按 Prettier 统一字符串引号风格。

Line 10 新增代码使用了单引号,与当前文件其余配置的双引号风格不一致;建议改为 Prettier 统一格式,避免后续 lint/format 噪音。

建议修改
-    config.resolve.alias['@vusion/utils'] = path.resolve(__dirname, 'src/utils');
+    config.resolve.alias["@vusion/utils"] = path.resolve(__dirname, "src/utils");

As per coding guidelines, **/*.{js,jsx,ts,tsx,vue,json}: Apply Prettier code formatting to all code files.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
config.resolve.alias['@vusion/utils'] = path.resolve(__dirname, 'src/utils');
config.resolve.alias["@vusion/utils"] = path.resolve(__dirname, "src/utils");
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/vue2/source/vue.config.js` at line 10, The new alias assignment uses
single quotes and conflicts with the file's double-quote style; update the
statement that sets config.resolve.alias['@vusion/utils'] to use double quotes
consistently (i.e., change the key and path strings to double quotes), then run
Prettier (or your project's format script) to reformat the file so it matches
the project's Prettier rules for JS/JSON files.

@YufJi YufJi merged commit 55c9135 into test May 12, 2026
2 checks passed
@YufJi YufJi deleted the bugfix/vue2-alias branch May 12, 2026 11:11
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