Typescript boilerplate
This commit is contained in:
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
modules
|
||||
node_modules
|
||||
19
index.html
Normal file
19
index.html
Normal 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
3
index.js
Normal file
@@ -0,0 +1,3 @@
|
||||
import { startApp } from "./modules/index.js";
|
||||
|
||||
startApp();
|
||||
8
src/index.ts
Normal file
8
src/index.ts
Normal 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
14
tsconfig.json
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "es2015",
|
||||
"outDir": "modules",
|
||||
"strictNullChecks": true,
|
||||
"target": "es2018"
|
||||
},
|
||||
"include": [
|
||||
"src/**/*/"
|
||||
],
|
||||
"exclude": [
|
||||
"node_modules"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user