-
Notifications
You must be signed in to change notification settings - Fork 132
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Add __generator helper to es6 source and populate jsnext:main #5
Merged
Merged
Changes from 5 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
9e0ff02
Add __generator helper to es6 source
frankwallis 0d128b4
populate jsnext:main in package.json to support rollup
frankwallis 2af77d7
Add __extends helper to es6 source
frankwallis b373b58
Change const -> var to support es6 modules with es5 target for rollup
frankwallis 0d1a736
Fix ordering of functions
frankwallis ee86b0c
add "module" field to package.json
frankwallis 69f20b4
Merge branch 'master' of https://github.com/Microsoft/tslib
frankwallis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,5 +27,6 @@ | |
"url": "https://github.com/Microsoft/tslib.git" | ||
}, | ||
"main": "tslib.js", | ||
"jsnext:main": "tslib.es6.js", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe use |
||
"typings": "tslib.d.ts" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how is this supposed to work on node versions that does not support
const
? i do not think rollup rewritesconst
tovar
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that is a very good point, this issue seems to indicate that it should point to a file which is consumable by all engines for using es6 import/export statements.
In my scenario I actually do a second typescript transpilation to output the rollup bundle in system.register format and that removes the const keywords.
Shall I change the file to use
export var
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems to me that the ideal solution would be to have a single typescript source file which is then compiled to both targets, but I'm not sure how to handle the UMD / global wrapper stuff in the es5 file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have updated the file to use
var
instead ofconst