1. webpack.config.js中的require会去查找package.json中的devDependencies,对应的值再去查找node_modules下的文件夹,找到后在文件夹中的package.json中查找main,main的值就是要加载的内容
2.devDependencies是开发过程中要用到的,dependencies是开发和上线后都要用到的
3.运行npm run eject可以把create-react-app内部的webpack配置文件解压出来。但是eject后与官方的更新不好同步,这对一个项目的稳定性很重要。基本上不用去改config里面的东西。这个脚手架的配置都在package.json里配置
4.
报错:
Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
- configuration.output.path: The provided value "./bin/" is not an absolute path!
解决办法:
npm install webpack@2.1.0-beta.22 --save-dev