Skip to content

Fix commonjs & umd exports - #5030

Merged
jasonsaayman merged 1 commit into
axios:v1.xfrom
ivanpepelko:v1.x
Oct 6, 2022
Merged

jasonsaayman merged 1 commit into
axios:v1.xfrom
ivanpepelko:v1.x

Conversation

@ivanpepelko

@ivanpepelko ivanpepelko commented Oct 6, 2022 •

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

2 participants