Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

记一次如何找到Object.assign()编译方法的历程 #3

Open
youngwind opened this issue Dec 6, 2015 · 0 comments
Open

记一次如何找到Object.assign()编译方法的历程 #3

youngwind opened this issue Dec 6, 2015 · 0 comments
Labels

Comments

@youngwind
Copy link
Owner

前言

我要用ES6的Object.assign()方法,但是存在兼容性问题,然后使用babel去编译它。没想到从babel6开始babel本身就不完成任何编译,需要安装插件来完成。
我在官网上寻寻觅觅了好久,安装了下面这一大堆插件。

    "babel-core": "^6.2.1",
    "babel-loader": "^6.2.0",
    "babel-preset-es2015": "^6.1.18",
    "babel-preset-react": "^6.1.18",
    "babel-preset-stage-0": "^6.1.18",
    "babel-runtime": "^5.8.25",

结果还是不行,各种百度和google都得不到答案,死的心都有了。。。
后来忽然想到直接在babel的github代码仓库中搜索,结果被我找到了这个。简直泪流满面啊!
2015-12-06 10 53 07

然后再结合babel的配置文件,比如这样就可以啦。
2015-12-06 10 56 11


结论:当你使用某个东西碰到解决不了的困难的时候,可以考虑一下直接在它的github仓库中搜索,或许会有意想不到的答案。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant