Last active
August 23, 2016 08:51
-
-
Save alexeyraspopov/5d5587ff5d1344f75c24 to your computer and use it in GitHub Desktop.
Watchify + React + HMR
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"env": { | |
"development": { | |
"plugins": ["react-transform"], | |
"extra": { | |
"react-transform": { | |
"transforms": [{ | |
"transform": "react-transform-hmr", | |
"imports": ["react"], | |
"locals": ["module"] | |
}] | |
} | |
} | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "name", | |
"version": "0.0.0", | |
"dependencies": { | |
"react": "~0.14.6", | |
"react-dom": "~0.14.6" | |
}, | |
"devDependencies": { | |
"babel": "5.8.34", | |
"babel-plugin-react-transform": "1.1.1", | |
"babelify": "6.4.0", | |
"browserify": "~13.0.0", | |
"browserify-hmr": "0.3.1", | |
"react-transform-hmr": "1.0.1", | |
"watchify": "~3.7.0" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
browserify -r react -r react-dom -o dist/vendor.js | |
watchify -e index.web.js \ | |
-x react -x react-dom \ | |
-t [ babelify --sourceMapRelative . ] \ | |
-p browserify-hmr \ | |
-o dist/bundle.js -dv |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment