-
Notifications
You must be signed in to change notification settings - Fork 528
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
feat(ts): expose built files in umd #4844
Conversation
This can be achieved using the dtsRollup feature of api-extractor, which isn't needed for the es build, as local files work perfectly fine in that case. Make sure to check the generated files when reviewing this PR
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 6c0279c:
|
https://codesandbox.io/s/instantsearch-js-forked-34p6s?file=/src/app.js proves that it works 🙌 |
); | ||
shell.cp( | ||
path.join(__dirname, '../../dist/instantsearch.production.d.ts'), | ||
path.join(__dirname, '../../dist/instantsearch.development.min.d.ts') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in which case do people need development.d.ts file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all the files are the same, but typescript works by matching a .d.ts file to a .js file, so if you're importing /dist/development.min.js then the .d.ts is needed for that to work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for explaining!
Summary
Exposes the entry point for umd for each of the umd entry points.
This is achieved using the dtsRollup feature of api-extractor, which isn't needed for the es build, as local files work perfectly fine in that case.
Make sure to check the generated files when reviewing this PR
Result
A situation like algolia/create-instantsearch-app#464 is done easier by simply declaring what's import from the umd