解决 These dependencies were not found: * core-js/modules/es6.array.fill in xxx 之类的问题

项目打包时出现了这种问题,说是core-js的包出了问题,但是我根本没有用它啊。

These dependencies were not found:

* core-js/fn/array/flat-map in ./node_modules/@babel/polyfill/lib/noConflict.js
* core-js/fn/promise/finally in ./node_modules/@babel/polyfill/lib/noConflict.js
* core-js/fn/string/pad-end in ./node_modules/@babel/polyfill/lib/noConflict.js
* core-js/fn/string/pad-start in ./node_modules/@babel/polyfill/lib/noConflict.js
* core-js/fn/string/trim-end in ./node_modules/@babel/polyfill/lib/noConflict.js
* core-js/fn/string/trim-start in ./node_modules/@babel/polyfill/lib/noConflict.js
* core-js/fn/symbol/async-iterator in ./node_modules/@babel/polyfill/lib/noConflict.js
* core-js/library/fn/array/is-array in ./node_modules/@babel/runtime-corejs2/core-js/array/is-array.js
* core-js/library/fn/global in ./node_modules/@babel/polyfill/lib/index.js
* core-js/library/fn/parse-float in ./node_modules/@babel/runtime-corejs2/core-js/parse-float.js
* core-js/library/fn/parse-int in ./node_modules/@babel/runtime-corejs2/core-js/parse-int.js

To install them, you can run: npm install --save core-js/fn/array/flat-map core-js/fn/promise/finally core-js/fn/string/pad-end core-js/fn/string/pad-start core-js/fn/string/trim-end core-js/fn/string/trim-start core-js/fn/symbol/async-iterator core-js/library/fn/array/is-array core-js/library/fn/global core-js/library/fn/parse-float core-js/library/fn/parse-int............

总之就是让你安装与core-js相关的东西。

解决方法:

在babel.config.js中添加:

presets: [ [ "@vue/app", { useBuiltIns: "entry" } ] ]

简单解决

posted @ 2020-04-06 22:21  青癯  阅读(10690)  评论(1编辑  收藏  举报