Module not found: Error: Can't resolve 'core-js/es6'

后端 未结 9 1312
轻奢々
轻奢々 2020-12-12 14:49

I\'ve got a problem with my build process in relation to my React app.

I always get the following error:

Module not found: Error: Can\'t resolve \'co

9条回答
  •  离开以前
    2020-12-12 15:20

    If you use @babel/preset-env and useBuiltIns, then you just have to add corejs: 3 beside the useBuiltIns option, to specify which version to use, default is corejs: 2.

    presets: [
      [
        "@babel/preset-env", {
          "useBuiltIns": "usage",
          "corejs": 3
        }
      ]
    ],
    

    For further details see: https://github.com/zloirock/core-js/blob/master/docs/2019-03-19-core-js-3-babel-and-a-look-into-the-future.md#babelpreset-env

提交回复
热议问题