解决方法应该是转载的,具体忘了是哪位大哥!!!非原创
项目打包时出现了这种问题,是一个叫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
ℹ 「hot」: webpack: Compiling Done
解决方法:
1.版本问题
npm install core-js@3 --save
# or
npm install core-js@2 --save
ps:我用了上面第一种方法就解决了,当然,如果还是没解决,还有第二种方法
2.也有人给出了这种方法:如果上面那种方式没有解决你的问题,你可以再试试这种方式;或者两种方式都用,都可以试着操作一样
//在babel.config.js中添加
presets: [ [ "@vue/app", { useBuiltIns: "entry" } ] ]