Last active
November 30, 2015 07:28
-
-
Save ambar/f30ce12d889dbe6468de to your computer and use it in GitHub Desktop.
source map bug:`serve -p 3000`
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 characters
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 characters
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 characters
"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 characters
<!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> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment