Initial Commit

This commit is contained in:
2018-12-25 07:55:07 -08:00
commit 0bb1bab900
8 changed files with 4346 additions and 0 deletions

4
.gitignore vendored Normal file
View File

@@ -0,0 +1,4 @@
*.swp
*.swo
dist/
node_modules

18
index.html Normal file
View File

@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html lang="en-US">
<head>
<title>Skiing - Aaron Gutierrez</title>
<link rel="stylesheet" href="site.css">
<meta charshet="utf-8">
<meta viewport="width=device-width, initial-scale=1">
</head>
<body>
<div id="mount">
<noscript>I don't like javascript, either.</noscript>
</div>
<script src="./node_modules/react/umd/react.development.js"></script>
<script src="./node_modules/react-dom/umd/react-dom.development.js"></script>
<script type="text/javascript" src="./dist/bundle.js"></script>
</body>
</html>

4223
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

28
package.json Normal file
View File

@@ -0,0 +1,28 @@
{
"name": "ski",
"version": "1.0.0",
"description": "Ski Photos",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "."
},
"author": "Aaron Gutierrez",
"license": "ISC",
"dependencies": {
"@types/react": "^16.7.18",
"@types/react-dom": "^16.0.11",
"react": "^16.7.0",
"react-dom": "^16.7.0"
},
"devDependencies": {
"awesome-typescript-loader": "^5.2.1",
"source-map-loader": "^0.2.4",
"typescript": "^3.2.2",
"webpack": "^4.28.2",
"webpack-cli": "^3.1.2"
}
}

11
src/index.tsx Normal file
View File

@@ -0,0 +1,11 @@
import { Root } from "./root";
import * as React from "react";
import * as ReactDOM from "react-dom";
window.onload = () => {
const body = document.getElementById("mount");
const root = <Root name="Friend" />;
ReactDOM.render(root, body);
};

15
src/root.tsx Normal file
View File

@@ -0,0 +1,15 @@
import * as React from "react";
export interface Props {
name: String;
}
export interface State {}
export class Root extends React.PureComponent<Props, State> {
static displayName = "Root";
render() {
return <h1>Hello, {this.props.name}!</h1>;
}
}

13
tsconfig.json Normal file
View File

@@ -0,0 +1,13 @@
{
"compilerOptions": {
"outDir": "./dist/",
"sourceMap": true,
"strictNullChecks": true,
"target": "es6",
"jsx": "react",
"module": "commonjs"
},
"include": [
"./src/**/*"
]
}

34
webpack.config.js Normal file
View File

@@ -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"
}
};