Made CommonJS the first branch of the export if statement #87
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi!
This recent PR added a named commonjs export for
Big
. @googol subsequently amended the DefinitelyTyped definitions to cater for this.Essentially the goal of his changes was to move usage in a more
es6
direction; namely making this legitimate:That's great, however webpack picks up the first exported branch it can when
Big
is exported. So it picks up the AMD export not the CommonJS export. You can work around this in webpack by deactivating AMD imports but that's somewhat brute force.Rather than doing that would you consider flipping the export order as I have done in this PR? So CommonJS is the first branch and AMD is the second. This will resolve issues for Big users of webpack with TypeScript in a hopefully "futurish" fashion.
If you're interested in the context for this then read a really long post here:
microsoft/TypeScript#18791
PS As an aside I updated the version number in line with the
package.json
.