Last active
April 22, 2016 09:31
-
-
Save johncip/934d7c353bfccf58d4515c87d59841e1 to your computer and use it in GitHub Desktop.
Browserify 3rd-party React components found on npm
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 3rd-party React components found on npm | |
# (prevents React & ReactDOM from being bundled) | |
export PACKAGE='simple-react-modal' # npm package | |
export EXPORT_NAME='SimpleReactModal' # will end up on window with this name | |
mkdir project && cd project | |
npm init -f | |
npm install -D browserify react react-dom | |
npm install $PACKAGE --save | |
echo "require('$PACKAGE');" > app.js | |
browserify app.js -o bundle.js -x react -x react-dom --standalone $EXPORT_NAME |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment