-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit e96f9a2
Showing
9 changed files
with
6,148 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
node_modules | ||
dist | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<title>Hello React!</title> | ||
</head> | ||
<body> | ||
<div id="example"></div> | ||
|
||
<!-- Dependencies --> | ||
<script src="./node_modules/react/umd/react.development.js"></script> | ||
<script src="./node_modules/react-dom/umd/react-dom.development.js"></script> | ||
|
||
<!-- Main --> | ||
<script src="./dist/bundle.js"></script> | ||
</body> | ||
</html> |
Large diffs are not rendered by default.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
"name": "tstest", | ||
"version": "1.0.0", | ||
"description": "", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1", | ||
"dev": "webpack" | ||
}, | ||
"keywords": [], | ||
"author": "", | ||
"license": "ISC", | ||
"devDependencies": { | ||
"awesome-typescript-loader": "^5.2.1", | ||
"source-map-loader": "^0.2.4", | ||
"typescript": "^3.7.5", | ||
"webpack": "^4.41.5", | ||
"webpack-cli": "^3.3.10", | ||
"webpack-dev-server": "^3.10.3" | ||
}, | ||
"dependencies": { | ||
"@types/react": "^16.9.19", | ||
"@types/react-dom": "^16.9.5", | ||
"@types/react-router-dom": "^5.1.3", | ||
"react": "^16.12.0", | ||
"react-dom": "^16.12.0", | ||
"react-router-dom": "^5.1.2" | ||
} | ||
} |
Empty file.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import * as React from "react"; | ||
|
||
export interface HelloProps { | ||
compiler: string; | ||
framework: string; | ||
} | ||
|
||
export const Hello = (props: HelloProps) => ( | ||
<h1> | ||
Hello from {props.compiler}and{props.framework}! | ||
</h1> | ||
); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import * as React from "react"; | ||
import * as ReactDOM from "react-dom"; | ||
|
||
import { Hello } from "./components/Hello"; | ||
|
||
ReactDOM.render( | ||
<Hello compiler="Typescript" framework="React" />, | ||
document.getElementById("example") | ||
); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"compilerOptions": { | ||
"outDir": "./dist/", | ||
"sourceMap": true, | ||
"noImplicitAny": true, | ||
"module": "commonjs", | ||
"target": "es5", | ||
"jsx": "react" | ||
}, | ||
"include": ["./src/**/*"] | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
module.exports = { | ||
entry: "./src/index.tsx", | ||
output: { | ||
filename: "bundle.js", | ||
path: __dirname + "/dist" | ||
}, | ||
|
||
// Enable sourcemaps for debugging webpack's output. | ||
devtool: "source-map", | ||
|
||
resolve: { | ||
// Add '.ts' and '.tsx' as resolvable extensions. | ||
extensions: [".ts", ".tsx", ".js", ".json"] | ||
}, | ||
|
||
module: { | ||
rules: [ | ||
// All files with a '.ts' or '.tsx' extension will be handled by 'awesome-typescript-loader'. | ||
{ test: /\.tsx?$/, loader: "awesome-typescript-loader" }, | ||
|
||
// All output '.js' files will have any sourcemaps re-processed by 'source-map-loader'. | ||
{ enforce: "pre", test: /\.js$/, loader: "source-map-loader" } | ||
] | ||
}, | ||
|
||
// When importing a module whose path matches one of the following, just | ||
// assume a corresponding global variable exists and use that instead. | ||
// This is important because it allows us to avoid bundling all of our | ||
// dependencies, which allows browsers to cache those libraries between builds. | ||
externals: { | ||
react: "React", | ||
"react-dom": "ReactDOM" | ||
} | ||
}; |