Last active
November 21, 2018 21:49
-
-
Save baetheus/03b7ef1c9abcff9f05390904329ede8c to your computer and use it in GitHub Desktop.
Parcel React Typescript Setup
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
| npm i @nll/{css,rx-fsa} lodash react react-dom redux | |
| npm i -D @nll/schematics-react @types/{lodash,node,react,react-dom,redux} parcel-bundler typescript |
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
| <html> | |
| <head> | |
| <title>Website</title> | |
| <link rel="stylesheet" type="text/css" href="styles/main.css" /> | |
| </head> | |
| <body> | |
| <main id="app"></main> | |
| </body> | |
| <script src="index.tsx"></script> | |
| </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'; | |
| const App: React.SFC = () => <section>Hello World</section>; | |
| const container = document.getElementById('app'); | |
| render(<App />, container); |
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 './vendor/nll-css'; |
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 '../../../node_modules/@nll/css/dist/main'; |
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
| { | |
| "build": "parcel build src/index.html", | |
| "clean": "rm -rf dist .cache", | |
| "g:c": "schematics @nll/schematics-react:component", | |
| "g:sc": "schematics @nll/schematics-react:stateless-component", | |
| "start": "parcel src/index.html -p 4200", | |
| "test": "echo \"Error: no test specified\" && exit 1" | |
| } |
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
| { | |
| "compilerOptions": { | |
| "strict": true, | |
| "strictFunctionTypes": true, | |
| "strictNullChecks": true, | |
| "strictPropertyInitialization": true, | |
| "allowUnreachableCode": false, | |
| "noImplicitAny": true, | |
| "noErrorTruncation": true, | |
| "alwaysStrict": true, | |
| "noUnusedLocals": true, | |
| "noUnusedParameters": true, | |
| "skipLibCheck": true, | |
| "lib": ["es5", "es6", "dom"], | |
| "types": ["node"], | |
| "jsx": "react", | |
| "baseUrl": "./src", | |
| "paths": { | |
| "$components/*": ["components/*"], | |
| "$environments/*": ["environments/*"], | |
| "$libraries/*": ["libraries/*"], | |
| "$pages/*": ["pages/*"], | |
| "$stores/*": ["stores/*"] | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment