Skip to content

keep old esm directory structure #1011

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

Merged
merged 3 commits into from
Mar 5, 2021
Merged

keep old esm directory structure #1011

merged 3 commits into from
Mar 5, 2021

Conversation

promer94
Copy link
Collaborator

@promer94 promer94 commented Mar 5, 2021

#932 accidentally changed the esm directory structure.

@codesandbox-ci
Copy link

codesandbox-ci bot commented Mar 5, 2021

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 37a55b8:

Sandbox Source
SWR-Basic Configuration
SWR-States Configuration
SWR-Infinite Configuration

tsconfig.json Outdated
@@ -24,7 +25,7 @@
},
"include": [
"src/**/*",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we also update this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#TIL

Importantly, rootDir does not affect which files become part of the compilation. It has no interaction with the include, exclude, or files tsconfig.json settings.
https://www.typescriptlang.org/tsconfig#rootDir

Copy link
Member

@shuding shuding Mar 5, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is confusing, so includes only determines which definitions get generated?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rootDir is used to keep the output's directory structure simple and clean
includes determines which file (must be in rootDir) will be compiled by tsc

We should have a separate tsconfig.test.json which is only used for ts-jest
In this way jest-setup.ts will not affect the output's directory structure anymore

Copy link
Member

@shuding shuding left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! ❤️

This was referenced Mar 12, 2021
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.

2 participants