编程语言/typescript/tsc:修订间差异
来自康健生活
< 编程语言 | typescript
创建页面,内容为“== 标题文本 ==” |
|||
| (未显示同一用户的1个中间版本) | |||
| 第1行: | 第1行: | ||
== 标题文本 == | == 标题文本 == | ||
== 构建 == | |||
=== 冗余引用 === | |||
在构建过程中,生成的产物引用组件被冗余,如 | |||
{{hc|head=lib/index.ts|output=<syntaxhighlight lang="bash"> | |||
import { withInstall } from '../src/utils/install' | |||
import '../src/assets/styles/index.css' | |||
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>}} | |||
2025年7月31日 (四) 16:32的最新版本
标题文本
构建
冗余引用
在构建过程中,生成的产物引用组件被冗余,如
lib/index.ts
import { withInstall } from '../src/utils/install'
import '../src/assets/styles/index.css'
export default {
withInstall,
}
export * from '../src/utils/install'
bundle/lib/index.d.ts
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';
bundle/src/utils/install.d.ts
import type { Component, Plugin } from 'vue';
export declare const withInstall: <T extends Component>(comp: T, name: string) => T & Plugin;
No categories