Webpack:We noticed you‘re using the `useBuiltIns` option without declaring a core-js version.
在webpack中采用@babel/preset-env编译js语法时,包如下错误
WARNING (@babel/preset-env): 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:npm install --save core-js@2 npm install --save core-js@3yarn add core-js@2 yarn add core-js@3More info about useBuiltIns: https://babeljs.io/docs/en/babel-preset-env#usebuiltins
More info about core-js: https://babeljs.io/docs/en/babel-preset-env#corejs
大致意思是让我要么在package.json中的dependencies中加入了"core-js"的某个版本,要么安装"core-js"(安装是不可能再安装的!)
关于Babel7.4.0官网对于配置@babel/preset-env中useBuiltIns的介绍
Please note that if you are relying on browserslist's defaults query (either explicitly or by having no browserslist config), you will want to check out the No targets section for information on preset-env's behavior.
请注意,如果您依赖于browserslist的defaults查询(无论是显式的还是通过没有browserslist配置),您将需要查看no targets部分以获取有关预设env行为的信息。
解决方案:
1、先安装依赖 core-js
2、再配置如下
Webpack:We noticed you‘re using the `useBuiltIns` option without declaring a core-js version.相关推荐
- webpack来打包你的vue项目,如发现你的vendor.js过大
1.如果你使用了webpack来打包你的vue项目,如发现你的vendor.js过大则可以参考本文的解决方案. 2.造成过大的原因是因为在main.js导入第三库太多时,webpack合并js时生成了 ...
- webpack——webpack与浏览器缓存(十六)
调整项目 项目结构: src/index.js import _ from 'lodash' import $ from 'jquery'const dom = $('<div>') do ...
- core-js@2 core-js@3报错问题
vue 编译提示安装 core-js,很有可能是这个错: WARNING: We noticed you're using the `useBuiltIns` option without decla ...
- webpack从入门到精通(三)生产环境的基本配置
1. 提取css成单独文件 1)创建文件 index.js中我们引入css文件 import '../css/a.css'; import '../css/b.css'; 2)下载plugin包 np ...
- (六)构建优化(揭开webpack性能优化的内幕)
构建优化 webpack的优化配置[了解这些优化配置才敢说会用webpack] Tree-shaking JS压缩 作用域提升 Babel的优化配置 webpack的依赖优化 noParse(不解析) ...
- (十)webpack 和 babel
webpack 和 babel webpack 面试题 基本配置 拆分配置和merge 启动本地服务 处理ES6 处理样式 处理图片 模块化 总结 高级配置 多入口 抽离css文件 抽离公共代码 懒加 ...
- webpack 合并压缩_webpack的运用
声明:受朋友之托,托管其原创文章.作者:JEN_最前端.个人主页:https://juejin.im/user/1011206430141975/post 补充知识点 Development 与 Pr ...
- Webpack 5 配置手册(从0开始)
webpack安装顺序 1. `npm init -y`,初始化包管理文件 package.json 2. 新建src源代码目录 3. 新建index.html 4. `yarn add webpac ...
- 安装webpack及使用
前言 你是否也是只会运用框架中集成好的Webpack配置呢?你明白每一项的意义么?你懂多少Webpack的个性化配置项呢?本篇文章为你讲解Webpack中的各种配置项参数及作用! 文章目录 了解Web ...
- webpack - 基础配置教程
目录 什么是webpack? 简要介绍 webpack中的模块 打包(bundle)的概念 webpack的工作 webpack如何分析模块依赖关系 webpack五大核心概念 entry outpu ...
最新文章
- Tomcat之the jre_home environment variable is not defined correctly this environment variable is need
- 密封槽设计标准_哈尔滨轴承 | 超全面机械密封选型
- 计算机硬件系统和软件系统
- struts 的action 线性安全问题
- PostgreSQL 字符串分隔函数(regexp_split_to_table、regexp_split_to_array) 发表于 2020-06-01 | 阅读次数: 394
- 为效能而生,企业级敏捷研发管理工具PingCode正式发布!
- 用C# Regex类实现的一些常规输入判断
- django的orm获取字段去重值
- idea加载jsp项目无法打开web页面
- √【物流网络规划】库存和仓储 warehouse
- ELK:ElasticSearch定期关闭和删除索引脚本
- 拥有mac动态壁纸Backgrounds——让桌面更生动
- ai旋转扭曲_AI变换及旋转图形工具详解
- 苹果App Store引发的悲喜狂欢
- JavaScript之简繁体转化代码示例
- 基于Java+SpringBoot+Vue+uniapp前后端分离图书阅读系统设计与实现
- 【windows10】 解决PPT不能播放视频
- 实用!7个强大的Python机器学习库!⛵
- Python-python程序打包为独立的EXE文件,并配上自定义的图标
- 歌名:江湖笑 演唱:周华健