编程语言/typescript/tsc:修订间差异
来自康健生活
创建页面,内容为“== 标题文本 ==” |
|||
| 第1行: | 第1行: | ||
== 标题文本 == | == 标题文本 == | ||
== 构建 == | |||
=== 冗余引用 === | |||
在构建过程中,生成的产物引用组件被冗余,如 | |||
{{hc|head=lib/index.ts|output=<syntaxhighlight lang="bash"> | |||
import { withInstall } from '../src/utils/install' | |||
export default { | |||
withInstall, | |||
} | |||
export * from '../src/utils/install' | |||
</syntaxhighlight>}} | |||
{{hc|head=bundle/lib/index.d.ts|output=<syntaxhighlight lang="bash"> | |||
import '../src/assets/styles/index.css'; | |||
declare const _default: { | |||
withInstall: <T extends import("vue").Component>(comp: T, name: string) => T & import("vue").Plugin; | |||
}; | |||
export default _default; | |||
export * from '../src/utils/install'; | |||
</syntaxhighlight>}} | |||
{{hc|head=bundle/src/utils/install.d.ts|output=<syntaxhighlight lang="bash"> | |||
import type { Component, Plugin } from 'vue'; | |||
export declare const withInstall: <T extends Component>(comp: T, name: string) => T & Plugin; | |||
</syntaxhighlight>}} | |||