Preset files are not allowed to export objects

前端 未结 10 1027
梦如初夏
梦如初夏 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:16

    Got the same issue in my webpack/react project - it seems that there was an issue with the .babelrc file.

    I updated it as seen below and it did the trick:

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

提交回复
热议问题