Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.1 Webpack 配置 React 开发环境 #6

Open
theJian opened this issue Apr 21, 2016 · 4 comments
Open

2.1 Webpack 配置 React 开发环境 #6

theJian opened this issue Apr 21, 2016 · 4 comments

Comments

@theJian
Copy link

theJian commented Apr 21, 2016

Webpack 使用一个名为 webpack.config.js 的配置文件,要编译 JSX,先安装对应的 loader: npm install babel-loader --save-dev

在我的环境下是 npm install babel-loader babel-core --save-dev, 不然执行 webpack -d --watch 会报找不到 babel-core 的错误.

@ofmiclee
Copy link

npm install babel-loader --save-dev 就可以了 babel-core在peerDependencies里

@theJian
Copy link
Author

theJian commented Apr 21, 2016

当我只执行 npm install babel-loader --save-dev 时会报以下警告
npm WARN babel-loader@6.2.4 requires a peer of babel-core@^6.0.0 but none was installed.
@ofmiclee 你知道是什么原因吗

@theJian
Copy link
Author

theJian commented Apr 21, 2016

@ofmiclee 啊, 我找到了, http://blog.npmjs.org/post/110924823920/npm-weekly-5
新的版本似乎不再自动安装 peerDependencies

@ofmiclee
Copy link

@theJian 是的 我的还是2.11.3老古董 会自动安装同伴依赖

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants