Solve the error: Module build failed (from ./node_modules/babel-loader/lib/index.js)

Full of red, desperate for honey

npm install npm -g
npm install --save core-js@^3
npm install babel-plugin-import --save

rm -rf node_modules
rm package-lock.json
npm cache clear --force

yarn install

 packages.json:

"babel": {
        "presets": [
            "@babel/env", "@babel/react"
        ],
        "plugins": [
            [
                "import",
                {
                    "libraryName": "antd",
                    "style": "css"
                }
            ]
        ]
    }

I don’t know why it works, I don’t know why it works. Anyway, it’s fine.

Reference: https://github.com/timarney/react-app-rewired/issues/84

Guess you like

Origin blog.csdn.net/geeksoarsky/article/details/99777723