Preset files are not allowed to export objects

前端 未结 10 981
梦如初夏
梦如初夏 2020-11-30 01:18

I have a carousel file in which I want to get index.js and build block.build.js, so my webpack.config.js is:



        
10条回答
  •  醉梦人生
    2020-11-30 02:09

    There are upgrades in babel 7 from version 6 refer to https://babeljs.io/docs/en/v7-migration. To solve the current problem/error

    Install

    npm install --save-dev @babel/preset-react
    
    npm install --save-dev @babel/preset-env
    

    then in .babelrc the dependency for presets should look like

    {
    
    "presets":["@babel/preset-env", "@babel/preset-react"],
    
       "plugins": [
        "react-hot-loader/babel", "transform-object-rest-spread"]
    
    }
    

提交回复
热议问题