webpack笔记

webpack使用中的错误:

1.npm run dev 出错

打包错误

in ./src/index.js
1
2
3
4
5
Module build failed: TypeError: fileSystem.statSync is not a function
at module.exports (/home/zaizizaizai/computerscience/project/react/ToDoList/node_modules/babel-loader/lib/utils/exists.js:7:25)
at find (/home/zaizizaizai/computerscience/project/react/ToDoList/node_modules/babel-loader/lib/resolve-rc.js:13:9)
at Object.module.exports (/home/zaizizaizai/computerscience/project/react/ToDoList/node_modules/babel-loader/lib/index.js:113:132)
@ multi main

原因及解决方法:

babel-loader7.x版本与webpack1.x不兼容,将babel-loader版本降到6.x

-------------本文结束感谢您的阅读-------------
显示 Gitment 评论