Webpack failed to introduce online packaging of babel- polyfils. The development environment is normal.

react project created based on creat-react-app,. In order to solve the compatibility of IE with some methods of Es6, babel-polyfill is introduced into the project. Can run normally in the local development environment, performing packaging upload to the server found that it did not take effect, and still reported an error

:
1 webpack.config.prod.js

2index.js

3npm run build

this should be that the packaging was not successful, right?

4, effect


entry: {
      main: ["babel-polyfill", paths.appIndexJs]
  },

in index.js, there is no need to import babel-polyfill, again and remove it directly

the order of execution in which you write that is in reverse


you don't have to repeat it twice. Just write at the top of index.js.

Menu