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

Add exports field to fix webpack errors #1617

Merged
merged 2 commits into from
Nov 12, 2024

Conversation

msujew
Copy link
Contributor

@msujew msujew commented Nov 11, 2024

Description

Adds a exports field to direct bundlers (mainly webpack) to the correct entry point. Having that entry in there is good practice anyway, and the other @inversifyjs/* packages already have an exports field.

Related Issue

#1616

Motivation and Context

I assume other people will have a similar issue when it comes to using webpack and CJS (i.e. require) of inversify.

How Has This Been Tested?

Applying this change to my local environment has fixed the issue reported in #1616.

Types of changes

  • Updated docs / Refactor code / Added a tests case (non-breaking change)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • I have updated the changelog.

@sdirix
Copy link

sdirix commented Nov 11, 2024

I tested the change locally on my system. It successfully fixes the issue in which webpack consumed inversify's esm build instead of commonjs although inversify was required.

package.json Outdated Show resolved Hide resolved
@notaphplover notaphplover self-requested a review November 11, 2024 23:57
Copy link
Member

@notaphplover notaphplover left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much ❤️

@notaphplover notaphplover merged commit 39db85a into inversify:master Nov 12, 2024
8 checks passed
Copy link

codecov bot commented Nov 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.53%. Comparing base (b5053d4) to head (057d22b).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1617   +/-   ##
=======================================
  Coverage   99.53%   99.53%           
=======================================
  Files          50       50           
  Lines        1492     1492           
  Branches      189      189           
=======================================
  Hits         1485     1485           
  Misses          4        4           
  Partials        3        3           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.

3 participants