Last active
August 26, 2018 07:17
-
-
Save rakannimer/eea2faf485f5b7b3e2062a1b53b73c6f to your computer and use it in GitHub Desktop.
parcel ts react starter
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<title>Page Title</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
</head> | |
<body> | |
<div id="root"></div> | |
<script src="./index.tsx"></script> | |
</body> | |
</html> |
This file contains hidden or 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
import * as React from 'react'; | |
import {render} from 'react-dom'; | |
export const App = () => { | |
return <div>Hello </div> | |
} |
This file contains hidden or 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
"scripts": { | |
"start": "parcel index.html" | |
} |
This file contains hidden or 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
mkdir $1 | |
cd $1 | |
yarn init # or yarn init -y | |
yarn add react react-dom | |
yarn add -D parcel-bundler typescript @types/react @types/react-dom prettier | |
touch .gitignore | |
echo "node_modules" >> .gitignore | |
echo ".cache" >> .gitignore | |
echo "dist" >> .gitignore |
This file contains hidden or 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
{ | |
"include": ["./src/"], | |
"compilerOptions": { | |
"jsx": "react", | |
"target": "es5", | |
"module": "ESNext", | |
"moduleResolution": "node", | |
"lib": ["es2018", "dom"], | |
"outDir": "./build/", | |
"strict": true, | |
"declaration": true, | |
"removeComments": true, | |
"esModuleInterop": true, | |
"allowSyntheticDefaultImports": true | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment