How to properly introduce babel-polyfill, into vue-cli and how does it work for third-party components that come in from import?

The

project introduces the Plyr video player component. An error has been reported in the vivo old model chrome 39 kernel, and it is found that Array.prototype.find is not supported. The solution is Plyr provides polyfilled version, import this can be

. The

question is why, when babel-polyfill is introduced, it doesn"t work on third-party js components that come in import ?

Mar.12,2021

after babel-polyfill is installed in the correct posture, there are three ways to quote it:

1.require ("babel-polyfill");

2.import "babel-polyfill";

3.module.exports = {

entry: ["babel-polyfill", ". / app/js"]

};

Note: the third method is suitable for students who use webpack to build. Add it to the webpack configuration file (webpack.config.js) entry item

re-execute the build command to open the page normally in an earlier version of the browser.

Menu