首页新闻找找看学习计划

node.js babel 不成功?

0
悬赏园豆:50 [待解决问题]
import 'babel-polyfill';

function g(func)
{
  console.log(func(1));
}

g(item => item + 1);

let obj = {
    "0" : 1,
    length: 1
};

let str = 'ha';
console.log(str.repeat(3));

let a = Array.from(obj);

console.log(a);

在已经安装了babel-polyfill的情况下

 

{
  "name": "sadtommy",
  "version": "1.0.0",
  "description": "sad tommy",
  "main": "index.js",
  "dependencies": {
    "babel-cli": "^6.24.1",
    "babel-core": "^6.25.0",
    "babel-polyfill": "^6.23.0",
    "babel-preset-es2015": "^6.24.1",
    "babel-preset-react": "^6.24.1"
  },
  "devDependencies": {
    "babel-cli": "^6.0.0",
    "babel-plugin-transform-runtime": "^6.23.0",
    "babel-polyfill": "^6.23.0",
    "babel-register": "^6.24.1"
  },
  "scripts": {
    "build": "babel babel/source -d babel/target"
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/CallMeTommy1988/qianduanxuexi.git"
  },
  "author": "tommy",
  "license": "ISC",
  "bugs": {
    "url": "https://github.com/CallMeTommy1988/qianduanxuexi/issues"
  },
  "homepage": "https://github.com/CallMeTommy1988/qianduanxuexi#readme"
}

并不转码,这让我很困惑,那里出问题了?

CallMeTommy的主页 CallMeTommy | 初学一级 | 园豆:70
提问于:2017-07-04 21:14
< >
分享
所有回答(1)
0

谁告诉你babel 是这样用的?去查官方文档吧。

幻天芒 | 园豆:36522 (高人七级) | 2017-07-04 21:45
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册