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

Production bundle for ES format is not enough for a development #140

Closed
danielkcz opened this issue Jun 12, 2019 · 3 comments · Fixed by #142
Closed

Production bundle for ES format is not enough for a development #140

danielkcz opened this issue Jun 12, 2019 · 3 comments · Fixed by #142

Comments

@danielkcz
Copy link
Contributor

Current Behavior

Webpack will use ES format but being in a development mode it means the wrong assumption from 3rd modules like invariant which then throws an error.

image

https://github.com/zertosh/invariant/blob/fae1c859f3eec25025dc6019bf7f7fdb78a27307/invariant.js#L26

Expected behavior

Same behavior as for CJS should be used and provide development bundle along with index.es.js.

Suggested solution(s)

Should be pretty straightforward to add a line in here...

https://github.com/palmerhq/tsdx/blob/943648edb06cd131f2c1751120cd1301804b480b/src/index.ts#L98

And utilize logic for creating index file...

https://github.com/palmerhq/tsdx/blob/943648edb06cd131f2c1751120cd1301804b480b/src/index.ts#L277

Your environment

Software Version(s)
TSDX 0.6.1
TypeScript 3.5.1
Browser N/A
Yarn 1.16.0
Operating System Windows x64
@TrySound
Copy link
Collaborator

I agree. ESM bundle should have NODE_ENV untouched.

@jaredpalmer
Copy link
Owner

Can you send a PR? I am out of office today. Should be straight forward

@danielkcz
Copy link
Contributor Author

Working on it :)

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 a pull request may close this issue.

3 participants