Skip to content

Refactor to avoid interoperability issues with ESM and CJS builds - #65

Merged
EmilianoSanchez merged 3 commits into
developmentfrom
CJS_and_ESM_interop_issues
Jan 6, 2022
Merged

Refactor to avoid interoperability issues with ESM and CJS builds#65
EmilianoSanchez merged 3 commits into
developmentfrom
CJS_and_ESM_interop_issues

Conversation

@EmilianoSanchez

@EmilianoSanchez EmilianoSanchez commented Jan 3, 2022

Copy link
Copy Markdown
Contributor

Javascript commons library

What did you accomplish?

  • Replaced default exports with named exports, to avoid issues with some particular Webpack configs that doesn't work fine with CommonJS modules transpiled by TSC.

  • Replaced object-assign dependency with an inline ES module version of it, to avoid extra configuration steps to handle CommonJS modules with bundlers that uses ESM by default (E.g.: no need to set CommonJS plugin in Rollup).

  • Added linter rule to avoid default exports.

How do we test the changes introduced in this PR?

Manually tested in rollup and webpack projects.

Extra Notes

@EmilianoSanchez EmilianoSanchez changed the title Refactor to avoid interoperability issues with ESM and CJS builds [WIP] Refactor to avoid interoperability issues with ESM and CJS builds Jan 4, 2022
@EmilianoSanchez
EmilianoSanchez merged commit dbe54ed into development Jan 6, 2022
@EmilianoSanchez
EmilianoSanchez deleted the CJS_and_ESM_interop_issues branch January 6, 2022 16:32
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