tg-commons
v1.2.11
Published
TG公共工具类
Keywords
Readme
tg-commons
TG Vue2/3共用工具类
发布
- 登录transcode-group帐号
pnpm login- 在根项目中执行:
pnpm publish:tg使用
pnpm add tg-commons项目中默认引用的是生成的js+d.ts, 若需要在VSCode跳转到源码, 需要做如下配置
- 在
tsconfig.json中, 将tg-commons指向源码:
{
"compilerOptions": {
"paths": {
"tg-commons": ["./node_modules/tg-commons/src/index"]
}
}
}- 源码中使用了vitest的内联代码测试功能, 主项目也要开启才不会报错. 若主项目没有开启内联代码测试, 或者没有使用vitest, 需要添加全局类型声明, 防止类型检查错误:
declare global {
interface ImportMeta {
readonly vitest: any
}
}