-
-
Save kkismd/774abf9532286fd9f9d010e7cf4fe4c5 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env sh | |
mkdir $1 | |
cd $1 | |
npm init -y | |
npm install -D babelify watchify babel-preset-es2015 babel-preset-react babel-plugin-syntax-flow babel-plugin-transform-flow-strip-types react react-dom | |
echo '{"presets": ["es2015", "react"], "plugins": ["transform-flow-strip-types", "syntax-flow"]}' > .babelrc | |
gibo Node OSX > .gitignore | |
cat <<EOF > .flowconfig | |
[ignore] | |
.*/node_modules/.* | |
[include] | |
[libs] | |
./interfaces | |
[options] | |
EOF | |
mkdir src | |
touch src/index.js | |
cat <<EOF > src/index.js | |
import ReactDOM from "react-dom"; | |
import React from "react"; | |
const el = document.querySelector(".main"); | |
ReactDOM.render(<h1>Hello</h1>, el) | |
EOF | |
mkdir interfaces | |
touch interfaces/externs.js | |
touch interfaces/globals.js | |
mkdir public | |
cat <<EOF > public/index.html | |
<html> | |
<head> | |
<title>app</title> | |
<meta charset="utf8" > | |
</head> | |
<body> | |
<div class="main"></div> | |
<script src="bundle.js"></script> | |
</body> | |
</html> | |
EOF | |
echo "public/bundle.js" >> .gitignore | |
git init | |
git add . | |
git commit -m "Initial commit" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment