Skip to content

Instantly share code, notes, and snippets.

@rakannimer
Last active August 26, 2018 07:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rakannimer/eea2faf485f5b7b3e2062a1b53b73c6f to your computer and use it in GitHub Desktop.
Save rakannimer/eea2faf485f5b7b3e2062a1b53b73c6f to your computer and use it in GitHub Desktop.
parcel ts react starter
<!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>
import * as React from 'react';
import {render} from 'react-dom';
export const App = () => {
return <div>Hello </div>
}
"scripts": {
"start": "parcel index.html"
}
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
{
"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