1
0
Fork 0

Add tsx syntax to main.

This commit is contained in:
Kitteh 2021-05-24 09:48:13 +01:00
parent df76573557
commit 92f976fc93
3 changed files with 17 additions and 30 deletions

View file

@ -17,45 +17,32 @@ import "prismjs/components/prism-json";
Prism.highlightAll();
/* eslint-enable */
// Actual Imports
// @ts-ignore
import translations from "./translations/index.mjs";
// Actual Imports
import { PageRouter } from "z-pagerouter";
import { formatDistance } from "./formatDistance";
import { getSealStatus } from "./api/sys/getSealStatus";
import { makeElement } from "z-makeelement";
import { pageList } from "./allPages";
import { pageState } from "./globalPageState";
import { playground } from "./playground";
import { reloadNavBar } from "./elements/NavBar";
import { render } from "preact";
import i18next from "i18next";
// @ts-ignore
import translations from "./translations/index.mjs";
async function onLoad(): Promise<void> {
document.body.innerHTML = "";
document.body.appendChild(makeElement({ tag: "div", id: "navBarBox" }));
document.body.appendChild(
makeElement({
tag: "div",
class: ["uk-container", "uk-container-medium", "uk-align-center"],
children: makeElement({
tag: "div",
class: ["uk-card", "uk-card-body"],
children: [
makeElement({
tag: "h3",
class: "uk-card-title",
id: "pageTitle",
text: "",
}),
makeElement({
tag: "div",
id: "pageContent",
}),
],
}),
}),
render(
<>
<div id="navBarBox" />
<div class="uk-container uk-container-medium uk-align-center">
<div class="uk-card uk-card-body">
<h3 class="uk-card-title" id="pageTitle" />
<div id="pageContent" />
</div>
</div>
</>,
document.body,
);
const pageRouter = new PageRouter(

View file

@ -12,7 +12,7 @@ let commitHash = gitRevisionPlugin.commithash();
module.exports = {
mode: "development",
cache: true,
entry: './src/main.ts',
entry: './src/main.tsx',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'bundle.js',

View file

@ -33,7 +33,7 @@ let commitHash = gitRevisionPlugin.commithash();
module.exports = {
mode: "production",
cache: false,
entry: './src/main.ts',
entry: './src/main.tsx',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'bundle.js',