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

Fix type declaration location when importing JSON #27

Merged
merged 1 commit into from
Sep 3, 2020

Conversation

ciaran16
Copy link
Contributor

@ciaran16 ciaran16 commented Sep 2, 2020

Using resolveJsonModule with TypeScript and importing ../package.json caused type declarations to be generated under dist/src rather than just dist. This is because importing something from the root directory changed rootDir to . instead of src. Since rollup inserts JSON directly we can just ignore JSON modules in TypeScript and let rollup handle it.

Fixes #26

See https://stackoverflow.com/questions/52121725/maintain-src-folder-structure-when-building-to-dist-folder-with-typescript-3 and microsoft/TypeScript#24715 for more info.

@ciaran16 ciaran16 merged commit cc34619 into master Sep 3, 2020
@ciaran16 ciaran16 deleted the fix/type-declaration-location branch September 3, 2020 14:01
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

Successfully merging this pull request may close these issues.

Type declaration file not present on package dist root directory.
3 participants