Last active
November 30, 2015 07:28
-
-
Save ambar/f30ce12d889dbe6468de to your computer and use it in GitHub Desktop.
Revisions
-
ambar revised this gist
Nov 30, 2015 . No changes.There are no files selected for viewing
-
ambar created this gist
Nov 30, 2015 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,2 @@ cp ./foo.es ./foo.js babel ./foo.js --preset es2015 --source-maps inline -o ./foo.js This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,2 @@ class Foo {} debugger This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,11 @@ "use strict"; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var Foo = function Foo() { _classCallCheck(this, Foo); }; debugger; //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImZvby5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7O0lBQU0sR0FBRyxZQUFILEdBQUc7d0JBQUgsR0FBRzs7O0FBQ1QsU0FBUSIsImZpbGUiOiJmb28uanMiLCJzb3VyY2VzQ29udGVudCI6WyJjbGFzcyBGb28ge31cbmRlYnVnZ2VyXG4iXX0= This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,32 @@ <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> </head> <body> <script> var fetchScript = function(scriptUrl) { fetch(scriptUrl) .then(function(r) { return r.text() }) .then(function(r) { // eval(r) eval(r + '\n//# sourceURL=' + scriptUrl) }) } var loadScript = function(scriptUrl) { var script = document.createElement('script') script.src = scriptUrl document.body.appendChild(script) } // var url = '/foo.js' var url = 'http://localhost:3000/foo.js' fetchScript(url) // loadScript(url) </script> </body> </html>