Typescript boilerplate

This commit is contained in:
2020-03-28 15:29:39 -07:00
parent d50016ffa0
commit 4f98b9a9b9
6 changed files with 46 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
modules
node_modules

19
index.html Normal file
View File

@@ -0,0 +1,19 @@
<!DOCTYPE html>
<html lang="en-US">
<head>
<title>Snappa</title>
<link rel="stylesheet" href="site.css">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script type="module" src="index.js"></script>
</head>
<body>
<header>
<h1>Snappa</h1>
</header>
<main>
<div id="main"></div>
<noscript>It's a Gentleman's Game</noscript>
</main>
</body>
</html>

3
index.js Normal file
View File

@@ -0,0 +1,3 @@
import { startApp } from "./modules/index.js";
startApp();

0
site.css Normal file
View File

8
src/index.ts Normal file
View File

@@ -0,0 +1,8 @@
export const startApp = () => {
const root = <HTMLDivElement>document.getElementById("main");
const div = document.createElement("div");
div.innerHTML = "Sup bro";
root.appendChild(div);
};

14
tsconfig.json Normal file
View File

@@ -0,0 +1,14 @@
{
"compilerOptions": {
"module": "es2015",
"outDir": "modules",
"strictNullChecks": true,
"target": "es2018"
},
"include": [
"src/**/*/"
],
"exclude": [
"node_modules"
]
}