@babel/runtime
๋ฐ๋ฒจ ๋ชจ๋๋ฌ ๋ฐํ์ ํฌํผ์ regenerator-runtime ๋ฒ์ ์ ํฌํจํ๋ ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ค.
Usage
@babel/plugin-transform-runtime๊ณผ ํจ๊ป runtime dependency๋ก ์ฌ์ฉ๋๋ค.
Why
๋ฐ๋ฒจ์ ์ด๋ค ๋์ผํ ์ฝ๋๋ฅผ output์ ์ฝ์ ํ์ฌ ์ ์ฌ์ ์ผ๋ก ์ฌ์ฌ์ฉ๋ ์ ์๋ค.
์๋ฅผ ๋ค์ด,
loose mode ์์ด class transform ์์ ๋ฅผ ๋ณด์.
class Circle {}๋ค์๊ณผ ๊ฐ์ด ์ปดํ์ผ๋๋ค.
function _classCallCheck(instance, Constructor) {
  //...
}
var Circle = function Circle() {
  _classCallCheck(this, Circle);
};class๋ฅผ ํฌํจํ๋ ๋ชจ๋  ํ์ผ์ _classCallCheck ํจ์๊ฐ ๋ฐ๋ณต๋๋ค.
@babel/plugin-transform-runtime์ ์ฌ์ฉํ๋ฉด, ํจ์์ ๋ํ ์ฐธ์กฐ๊ฐ์ @babel/runtime version์ผ๋ก ๋์ฒดํ ์ ์๋ค.
var _classCallCheck = require("@babel/runtime/helpers/classCallCheck");
var Circle = function Circle() {
  _classCallCheck(this, Circle);
};@babel/runtime์ ๋จ์ํ ๋ชจ๋๋ฌ ๋ฐฉ์์ผ๋ก ํจ์ ๊ตฌํ์ ํฌํจํ๋ ํจํค์ง๋ค.
Last updated
Was this helpful?
