Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nervjs 1.5.7 typings 路径错误 #164

Open
FredZeng opened this issue Jul 7, 2020 · 1 comment
Open

nervjs 1.5.7 typings 路径错误 #164

FredZeng opened this issue Jul 7, 2020 · 1 comment

Comments

@FredZeng
Copy link

FredZeng commented Jul 7, 2020

Version: nervjs 1.5.7
现象:使用 TS 时,nervjs 类型无法正常提示
原因:

package.json 中指定的 typings 路径为 index.d.ts

{
  "name": "nervjs",
  "version": "1.5.7",
  "description": "A react-like framework based on virtual-dom",
  "main": "index.js",
  "module": "dist/index.esm.js",
  "jsnext:main": "dist/index.esm.js",
  "typings": "index.d.ts",
  "unpkg": "dist/nerv.js",
}

npm包中实际的typing路径为 dist/index.d.ts

├── CHANGELOG.md
├── README.md
├── dist
│   ├── index.d.ts # d.ts
│   ├── index.esm.js
│   ├── index.esm.js.map
│   ├── index.js
│   ├── index.js.map
│   ├── index.prod.js
│   ├── nerv.js
│   ├── nerv.js.map
│   ├── nerv.min.js
│   └── packages
├── index.js
└── package.json
@FredZeng FredZeng changed the title nervjs 1.5.7 typings 指定错误 nervjs 1.5.7 typings 路径错误 Jul 7, 2020
@zqinmiao
Copy link

+1,刚刚也发现了。

不过可以在项目根目录下建个.d.ts文件,里面使用reference来解决

/// <reference path="node_modules/nervjs/dist/index.d.ts" />

话说,nervjs是没人维护了吗?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants