-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(es2015): add es2015 implementation to support rollup (#10)
* feat(es2015): add es2015 implementation to support rollup The build now comes from the es2015 files under the `es/` directory. closes #9 * chore(package): add es files and lib files to npm files * chore(package): ensure build and test before publish * refactor(ponyfill): make Symbol const * chore(ponyfill test): update tests to look at built file * refactor(all): ensure only es6 feature used is modules
- Loading branch information
Showing
7 changed files
with
30 additions
and
16 deletions.
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"presets": ["es2015"], | ||
"plugins": ["add-module-exports"], | ||
} |
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 |
---|---|---|
@@ -1 +1,2 @@ | ||
node_modules | ||
lib |
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/* global window */ | ||
import ponyfill from './ponyfill'; | ||
|
||
let root = this; | ||
This comment has been minimized.
Sorry, something went wrong. |
||
if (typeof global !== 'undefined') { | ||
root = global; | ||
} else if (typeof window !== 'undefined') { | ||
root = window; | ||
} | ||
|
||
export default ponyfill(root); |
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
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 |
---|---|---|
@@ -1,10 +1 @@ | ||
/* global window */ | ||
'use strict'; | ||
|
||
var root = this; | ||
if (typeof global !== 'undefined') { | ||
root = global; | ||
} else if (typeof window !== 'undefined') { | ||
root = window; | ||
} | ||
module.exports = require('./ponyfill')(root); | ||
module.exports = require('./lib/'); |
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
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
es modules doesn't have own context. And top-level
this
keyword compiles toundefined
by rollup. It's possible to setcontext
option. But it's a hack. Let's do something like this