terrierscript
3/16/2016 - 2:51 PM

babel-polyfillとbabel-runtimeの使い分けに迷ったので調べた ref: https://qiita.com/terrierscript/items/d2a9d5d4daedaacff924

babel-polyfillとbabel-runtimeの使い分けに迷ったので調べた ref: https://qiita.com/terrierscript/items/d2a9d5d4daedaacff924

Uncaught Error: only one instance of babel-polyfill is allowed
Uncaught Error: only one instance of babel-polyfill is allowed
<!-- どっちも import "babel-polyfill" しているとすると・・・ -->
<script type="text/javascript" src="./script1.js">
</script>
<script type="text/javascript" src="./script2.js">
</script>
Object.entries({"foo": "baz"})
<!-- どっちも import "babel-polyfill" しているとすると・・・ -->
<script type="text/javascript" src="./script1.js">
</script>
<script type="text/javascript" src="./script2.js">
</script>
import "babel-polyfill"
Object.entries({"foo": "baz"})
(0, _entries2.default)({
    "foo": "baz"
});