Closed Tankpt closed 8 years ago
I just find in react-redux package.jon . react do not as a dependencies but as a peerDependencies 。 In npm3 peerDependencies will not install?
Will this peerDependencies caus the error?
Hard to say without code. We'll need a reproducible project to look further.
Thanks for you reply. And I made a demo as follow. https://github.com/Tankpt/react-redux I just package the react-redux with 'npm run redux'.
Ah. Browserify doesn't transform stuff in your node_modules
folder. You have to run it as a global transform:
{
"name": "react-redux",
"version": "0.0.1",
"description": "",
"main": "index.js",
"scripts": {
"redux": "rm -rf react-redux.js && browserify -g browserify-shim -x react -s ReactRedux -e ./node_modules/react-redux > react-redux.js"
},
"repository": {
"type": "git",
"url": "git@github.com:Tankpt/react-redux.git"
},
"keywords": [],
"license": "MIT",
"homepage": "https://github.com/Tankpt/react-redux",
"dependencies": {
"react-redux": "^4.0.4",
"redux": "^3.0.0"
},
"devDependencies": {
"browserify": "~13.0.0",
"browserify-shim": "~3.8.12"
},
"browserify-shim": {
"react": "global:React"
}
}
Thx
Here is my config
I still find require('react') in the build file