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

Move type declarations to root dir #74

Closed
ingver opened this issue Mar 28, 2019 · 3 comments
Closed

Move type declarations to root dir #74

ingver opened this issue Mar 28, 2019 · 3 comments

Comments

@ingver
Copy link

ingver commented Mar 28, 2019

In current version (1.0.0) type declarations are published under dist/ts/src and when importing for example by the default VS Code action, the result is:

image

Besides unfancy look, it leads to error during compilation

Module not found: Error: Can't resolve 'constate/dist/ts/src' in 'C:\source\project\src'
...
@diegohaz
Copy link
Owner

diegohaz commented Mar 28, 2019

That's a bug in VSCode/IntelliSense, isn't it?

Does it work if you manually remove /dist/ts/src?

@ingver
Copy link
Author

ingver commented Mar 28, 2019

That's a bug in VSCode/IntelliSense, isn't it?

Not sure. Should it work another way? If .d.ts file is in /dist/ts/src, why should it point to /?

Does it work if you manually remove /dist/ts/src?

Yep, it works. But I must manually write import or edit every auto-import statement.

@diegohaz
Copy link
Owner

If .d.ts file is in /dist/ts/src, why should it point to /?

Honestly, I'm not sure how VSCode parses it, but the types field in package.json is pointing to dist/ts/src:

"types": "dist/ts/src",

That should be enough to VSCode understand it. That's why I think it's a bug in VSCode.

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