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 build failure for TS consumers #39

Merged
merged 1 commit into from
Nov 9, 2021

Conversation

amitlevy21
Copy link

@amitlevy21 amitlevy21 commented Nov 9, 2021

Before this commit, Typescript consumers would get the following error:
"This module can only be referenced with ECMAScript imports/exports by turning on the 'esModuleInterop' flag and referencing its default export"
consumers of this library would have to set esModuleInterop to true in
their tsconfig.json in order to build with this library.

With this commit, consumers can simply import without adding
esModuleInterop to their configuration.

Examples:

// ES6:
import { PromisePool } from '@supercharge/promise-pool'

// ES5:
const { PromisePool } = require('@supercharge/promise-pool')

Closes: #38

@marcuspoehls Let me know what you think, Thank you!

Before this commit, Typescript consumers would get the following error:
"This module can only be referenced with ECMAScript imports/exports by turning on the 'esModuleInterop' flag and referencing its default export"
consumers of this library would have to set `esModuleInterop` to true in
their `tsconfig.json` in order to build with this library.

With this commit, consumers can simply import without adding
`esModuleInterop` to their configuration.

Examples:
ES6:
import { PromisePool } from '@supercharge/promise-pool'

ES5:
const { PromisePool } = require('@supercharge/promise-pool')

Closes: supercharge#38
@marcuspoehls marcuspoehls merged commit 710e6bc into supercharge:main Nov 9, 2021
@amitlevy21 amitlevy21 deleted the fix-ts-esModuleInterop branch November 9, 2021 12:26
@marcuspoehls
Copy link
Member

@amitlevy21 Thank you Amit! Looks good 👍 I’ll publish these changes on NPM as a new major release. It requires users to update their imports of the promise pool (as you did in the tests).

@amitlevy21
Copy link
Author

@marcuspoehls Great! Happy to help 🚀

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