在react 脚手架项目中配置webpack , 启动时报错如图
modules by path ./node_modules/ 1010 KiB
modules by path ./node_modules/webpack/hot/*.js 4.3 KiB 4 modules
modules by path ./node_modules/scheduler/ 26.3 KiB 4 modules
modules by path ./node_modules/react/ 70.6 KiB 2 modules
modules by path ./node_modules/react-dom/ 875 KiB 2 modules
modules by path ./node_modules/css-loader/dist/runtime/*.js 3.79 KiB 2 modules
modules by path ./src/ 3.58 KiB
modules by path ./src/*.js 937 bytes
./src/index.js 542 bytes [built] [code generated]
./src/reportWebVitals.js 395 bytes [built] [code generated]
modules by path ./src/*.css 2.67 KiB
./src/index.css 1.32 KiB [built] [code generated]
./node_modules/css-loader/dist/cjs.js!./src/index.css 1.35 KiB [built] [code generated]
ERROR in ./src/index.js 4:0-24
Module not found: Error: Can't resolve './App' in 'E:\frontEndProject\test\src'
resolve './App' in 'E:\frontEndProject\test\src'
using description file: E:\frontEndProject\test\package.json (relative path: ./src)
Field 'browser' doesn't contain a valid alias configuration
using description file: E:\frontEndProject\test\package.json (relative path: ./src/App)
no extension
Field 'browser' doesn't contain a valid alias configuration
E:\frontEndProject\test\src\App doesn't exist
.js
Field 'browser' doesn't contain a valid alias configuration
E:\frontEndProject\test\src\App.js doesn't exist
.json
Field 'browser' doesn't contain a valid alias configuration
E:\frontEndProject\test\src\App.json doesn't exist
.wasm
Field 'browser' doesn't contain a valid alias configuration
E:\frontEndProject\test\src\App.wasm doesn't exist
as directory
E:\frontEndProject\test\src\App doesn't exist