为什么我run build的时候提示这个?

来源:5-2 babel环境安装(2)

lcyjerry

2020-04-30 14:55:25

WARNING: We noticed you're using the `useBuiltIns` option without declaring a core-js version. Currently, we assume version 2.x when no version is passed. Since this default version will likely change in future versions of Babel, we recommend explicitly setting the core-js version you are using via the `corejs` option.


You should also be sure that the version you pass to the `corejs` option matches the version specified in your `package.json`'s `dependencies` section. If it doesn't, you need to run one of the following commands:


写回答

4回答

好帮手慕慕子

2020-04-30

同学你好,看你截图可能是build配置不对,没有配置编译后输出到哪个文件

http://img.mukewang.com/climg/5eaaafd7096ae21715080426.jpg

建议修改为:

"build": "babel entry.js -o index.js -w"

同学可以测试下,如果还有问题,可以将你写的代码和文件目录截图也粘贴过来,便于帮助同学准确的定位与解决问题。

祝学习愉快~

0

lcyjerry

提问者

2020-04-30

http://img.mukewang.com/climg/5eaa85a5097bfb2108300659.jpg

http://img.mukewang.com/climg/5eaa85a50917078b06090474.jpg


0

好帮手慕慕子

2020-04-30

同学你好, 由于环境等问题,老师这边测试无法复现同学的问题,这个是警告信息不是错误信息,不会影响同学的代码运行,同学可以忽略的,重点放在课程内容的学习上

如果影响到了同学代码效果的实现,可以将你node版本号和具体操作的步骤以及配置文件图文结合粘贴过来,老师帮助同学再测试下

祝学习愉快~

0
hcyjerry
h 老师我按照官方的文档安装的babel 没有根据老师来,编译成功后发现文件还是原来的es6语法,正常吗?还是说现在浏览器可以识别es6了?
h020-04-30
共1条回复

好帮手慕慕子

2020-04-30

同学你好,这是一个警告提示信息,即:警告在使用useBuiltIns选项时,需要声明core-js的版本,不会影响代码的正常运行,同学可以忽略的。祝学习愉快~

0
hcyjerry
h 而且这样也不会编译我的es6代码啊
h020-04-30
共2条回复

0 学习 · 10739 问题

查看课程