-
Notifications
You must be signed in to change notification settings - Fork 375
feat: external all dependencies of core package #1236
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
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -32,7 +32,7 @@ export default defineConfig({ | |||||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||||||
rollupOptions: { | ||||||||||||||||||||||||||||||||||
// 确保外部化处理那些你不想打包进库的依赖 | ||||||||||||||||||||||||||||||||||
external: ['vue', 'vue-i18n'], | ||||||||||||||||||||||||||||||||||
external: ['vue', 'vue-i18n', '@vue/shared'], | ||||||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainGood externalization of @vue/shared dependency. Adding Consider whether you need to add '@vue/shared' to the globals object for UMD builds: 🏁 Script executed: #!/bin/bash
# Check if @vue/shared is used in UMD builds and needs a global variable mapping
# Search for imports of @vue/shared in the webcomponent package
rg -A 2 "from ['\"]\@vue/shared['\"]" packages/webcomponent/ Length of output: 167 I’ll check the Vite config and scan for any actual imports of 🏁 Script executed: #!/bin/bash
set -e
echo "1) Locate Vite config for webcomponent package"
rg -l "vite.config.js"
echo -e "\n2) Show externals & globals in vite.config.js"
sed -n '1,200p' packages/webcomponent/vite.config.js | sed -n '30,60p'
echo -e "\n3) Find any usage of @vue/shared in source files"
rg -n "@vue/shared" packages/webcomponent Length of output: 1407 Add missing UMD global for The webcomponent bundle imports utilities from • File: packages/webcomponent/vite.config.js Suggested diff: output: {
globals: {
vue: 'Vue',
'vue-i18n': 'VueI18n',
+ '@vue/shared': 'VueShared'
}
} 📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||||||||
output: { | ||||||||||||||||||||||||||||||||||
// 在 UMD 构建模式下为这些外部化的依赖提供一个全局变量 | ||||||||||||||||||||||||||||||||||
globals: { | ||||||||||||||||||||||||||||||||||
|
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.
这个包是不是可以删除了,已经没有用到了
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.
可以,下次 PR 变更上来