Skip to content

Commit

Permalink
chore: 增加页面使用@Kit开头的包名的警告
Browse files Browse the repository at this point in the history
  • Loading branch information
Wangyaqi committed Feb 11, 2025
1 parent ca9b08c commit bc0e236
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/uni-app-harmony/src/compiler/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@ export function uniAppHarmonyPlugin(): UniVitePlugin {
external: [...Object.keys(commandGlobals), ...harmonyGlobals],
output: {
globals: function (id: string) {
if (id.startsWith('@kit.')) {
console.warn(
'@kit开头的包无法在页面或组件内正常使用,请改用其他方式引用,或使用uts插件引用。'
)
}
return (
commandGlobals[id] ||
(isHarmonyGlobal(id)
Expand Down

0 comments on commit bc0e236

Please sign in to comment.