Last active
August 29, 2015 14:27
-
-
Save spion/3edbafef55f4975e19c9 to your computer and use it in GitHub Desktop.
Initialize typescript/react project
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
tsc | |
browserify lib/main.js -o bundle.js -d |
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
# This is where we will keep definitions of external libraries | |
# e.g. https://github.com/borisyankov/DefinitelyTyped/blob/master/react/react.d.ts | |
mkdir d.ts | |
# Our sources will go here | |
mkdir src | |
# Compiled JS and sourcemaps go here | |
mkdir lib | |
# We need to initialize our package.json to store dependencies | |
npm init | |
# Add react | |
npm install --save react | |
# Add react definitions | |
curl https://raw.githubusercontent.com/borisyankov/DefinitelyTyped/master/react/react.d.ts > d.ts/react.d.ts |
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
npm install -g typescript browserify watchify |
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
Show hidden characters
{ | |
"compilerOptions": { | |
"module": "commonjs", | |
"noImplicitAny": true, | |
"outDir": "lib/", | |
"sourceMap": true, | |
"noLib": false, | |
"target": "es5", | |
"declaration": false, | |
"jsx": "react" | |
}, | |
"filesGlob": [ | |
"d.ts/**/*.d.ts", | |
"src/**/*.ts" | |
] | |
} |
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
tsc -w & | |
watchify lib/main.js -o lib.bundle.js -d |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment