Created
April 27, 2020 03:12
-
-
Save wdsrocha/4f521a7e7e61da7a88192cc33b8b9199 to your computer and use it in GitHub Desktop.
Use after running the create-react-app script to have a cleaner "hello, world" app.
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
#!/bin/bash | |
# exit when any command fails | |
set -e | |
rm public/{*.png,manifest.json,robots.txt} | |
cat > public/index.html << EOF | |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8" /> | |
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1" /> | |
<meta name="theme-color" content="#000000" /> | |
<title>App title</title> | |
</head> | |
<body> | |
<noscript>You need to enable JavaScript to run this app.</noscript> | |
<div id="root"></div> | |
</body> | |
</html> | |
EOF | |
rm src/{index.css,App.test.js,serviceWorker.js,logo.svg,setupTests.js} | |
cat > src/index.js << EOF | |
import React from 'react'; | |
import ReactDOM from 'react-dom'; | |
import App from './App'; | |
ReactDOM.render( | |
<React.StrictMode> | |
<App /> | |
</React.StrictMode>, | |
document.getElementById('root') | |
); | |
EOF | |
cat > src/App.js << EOF | |
import React from 'react'; | |
import './App.css' | |
export default function App() { | |
return ( | |
<h1>Hello, world!</h1> | |
); | |
} | |
EOF | |
cat > src/App.css << EOF | |
* { | |
margin: 0; | |
padding: 0; | |
outline: 0; | |
box-sizing: border-box; | |
/* outline-offset: -1px; | |
outline: 1px red dashed; */ | |
} | |
EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment