下面是我npm包里面 package.json 文件
`{
"name": "npm-template-of-ts",
"version": "1.0.0",
"description": "typeScript npm template",
"main": "index.js",
"dependencies": {
},
"scripts": {
"build": "tsc",
"test": "jest"
},
"author": {
"name": "hyzhang",
"email": "zhanghongyi@flexem.cn"
},
"license": "MIT",
"keywords": [
"typeScript npm template npm-template-of-ts"
],
"devDependencies": {
"jest": "^24.8.0",
"typescript": "^3.4.5"
}
}`
发布到我的私有仓库后
new 了个新的angular 项目并且 install我发布的包
我在angular里面引用如下图
1、我在vscode 使用f12跟踪代码不能跳转?
2、安装下图的方法调用我可以调用到sayHello方法,并且可以打印出hello
可能是 package.json 里少了
"typings": {// 你的类型定义文件 *.d.ts的路径}