解決報錯:Module build failed (from ./node_modules/babel-loader/lib/index.js)

滿屏紅,蜜汁絕望

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"
                }
            ]
        ]
    }

不知道爲啥就好使了,我也不知道爲什麼就好使了,反正就好使了,枯了

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

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章