File tree Expand file tree Collapse file tree 8 files changed +591
-497
lines changed Expand file tree Collapse file tree 8 files changed +591
-497
lines changed Original file line number Diff line number Diff line change 1
1
{
2
- "presets" : [" es2015" ]
2
+ "presets" : [
3
+ [
4
+ " env" ,
5
+ {
6
+ "targets" : {
7
+ "browsers" : [" last 2 versions" ]
8
+ }
9
+ }
10
+ ]
11
+ ]
3
12
}
Original file line number Diff line number Diff line change @@ -87,7 +87,9 @@ <h3>Warnings</h3>
87
87
< script src ="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.17.0/codemirror.js "> </ script >
88
88
< script src ="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.17.0/mode/javascript/javascript.js "> </ script >
89
89
90
- < script src ="https://cdnjs.cloudflare.com/ajax/libs/babel-standalone/6.10.3/babel.js "> </ script >
90
+ < script src ='https://unpkg.com/babel-standalone@6/babel.js ' defer > </ script >
91
+ < script src ='https://unpkg.com/babel-polyfill@6/dist/polyfill.min.js ' defer > </ script >
92
+ < script src ='
https://unpkg.com/[email protected] /babel-preset-env.js '
defer > </ script >
91
93
< script src ="repl-browser.js "> </ script >
92
94
93
95
< script >
@@ -105,7 +107,7 @@ <h3>Warnings</h3>
105
107
continueComments : "Enter" ,
106
108
readOnly : true
107
109
} ;
108
-
110
+
109
111
var input = CodeMirror ( document . getElementById ( 'input' ) , inputOpts ) ;
110
112
var output = CodeMirror ( document . getElementById ( 'output' ) , outputOpts ) ;
111
113
@@ -141,4 +143,4 @@ <h3>Warnings</h3>
141
143
document . getElementById ( 'es5' ) . onchange = function ( ) { change ( input ) }
142
144
</ script >
143
145
</ body >
144
- </ html >
146
+ </ html >
Original file line number Diff line number Diff line change @@ -157,15 +157,16 @@ module.exports = function () {
157
157
158
158
// super-simple in-browser REPL for testing this thing
159
159
// to build:
160
- //
160
+ //
161
161
// npm install -g browserify
162
162
// browserify repl.js -o repl-browser.js
163
163
164
164
var plugin = require ( '../babel-ng-annotate' ) ;
165
165
166
166
window . transform = function ( code , es2015 ) {
167
+
167
168
return Babel . transform ( code , {
168
- presets : es2015 ? [ 'es2015' ] : [ ] ,
169
+ presets : es2015 ? [ window . babelPresetEnv . default ] : [ ] ,
169
170
plugins : [ plugin ]
170
171
} ) ;
171
172
} ;
Original file line number Diff line number Diff line change 1
1
// super-simple in-browser REPL for testing this thing
2
2
// to build:
3
- //
3
+ //
4
4
// npm install -g browserify
5
5
// browserify repl.js -o repl-browser.js
6
6
7
7
var plugin = require ( '../babel-ng-annotate' ) ;
8
8
9
9
window . transform = function ( code , es2015 ) {
10
+
10
11
return Babel . transform ( code , {
11
- presets : es2015 ? [ 'es2015' ] : [ ] ,
12
+ presets : es2015 ? [ window . babelPresetEnv . default ] : [ ] ,
12
13
plugins : [ plugin ]
13
14
} ) ;
14
- }
15
+ }
You can’t perform that action at this time.
0 commit comments