这个错误是我在用vue-cli
中使用webpack
打包的时候,进行环境分离操作,将webpack.config.js
分成三个包
之后启动npm run serve
(也就是webpack-dev-server --open
)的时候报的错误,package.json
文件是下面这样
"scripts": {
"serve": "webpack-dev-server --open",
"build": "webpack --config webpack.prod.js"
},
ERROR in Entry module not found: Error: Can’t resolve ‘./src’ in ‘E:\professer\lagou\lagou-homework\fed-e-task-02-02\code\vue-app-base’
ERROR in multi (webpack)-dev-server/client?http://localhost:8080 ./src
Module not found: Error: Can’t resolve ‘./src’ in ‘E:\professer\lagou\lagou-homework\fed-e-task-02-02\code\vue-app-base’
@ multi (webpack)-dev-server/client?http://localhost:8080 ./src main[1]
默认的配置入口是webpack.config.js
,修改之后webpack-dev-server
命令找不到打包入口。
指定运行配置文件为webpack.dev.js
"scripts": {
"serve": "webpack-dev-server --config webpack.dev.js --open",
"build": "webpack --config webpack.prod.js"
},
it works~