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 commonjs & umd exports #5030

Merged
merged 1 commit into from Oct 6, 2022
Merged

Fix commonjs & umd exports #5030

merged 1 commit into from Oct 6, 2022

Conversation

ivanpepelko
Copy link
Contributor

@ivanpepelko ivanpepelko commented Oct 6, 2022

Fixes the following issues (missing default export):

Also fixes rollup build, an issue introduced in d61dbed. After these exports were added, rollup could not produce builds with exports: "default", as it is not able to conclude what to do in this case (see here).

Exporting a member named default and changing rollup configuration resolves all of the mentioned issues and successfully creates production builds.

@jasonsaayman
Copy link
Member

@ivanpepelko can you validate that this fix works locally as I cannot validate it right now but would like to release this asap.

@ivanpepelko
Copy link
Contributor Author

@ivanpepelko can you validate that this fix works locally as I cannot validate it right now but would like to release this asap.

I did, the same way as explained in #5008, just without typescript.


This is my test script:

const axios = require('./dist/node/axios.cjs').default;

console.log({
  static: axios,
  factory: axios.create,
  instance: axios.create(),
});

Before the patch, the script crashed.
After the patch, it works as intended and described in docs.

@jasonsaayman
Copy link
Member

Cool thanks 🚀

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.

None yet

2 participants