我运行了这些命令:
1. npm install --save react
2. npm install --save react-dom
3. npm install --save--dev babel-core babel-loader babel-presetreact
Angular工作正常,React在脚本标记中使用CDN时起作用。但我想通过捆绑使用它,我该如何调试呢?
这是我的package.json文件的样子:
{
"name": "myApp",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"build": "webpack",
"start": "webpack-dev-server"
},
"author": "",
"license": "ISC",
"dependencies": {
"angular": "^1.6.0",
"react": "^15.4.1",
"react-dom": "^15.4.1"
},
"devDependencies": {
"babel-core": "^6.21.0",
"babel-loader": "^6.2.10",
"babel-preset-es2015": "^6.18.0",
"babel-preset-react": "^6.16.0",
"webpack": "^1.14.0",
"webpack-dev-server": "^1.16.2"
}
}