refactor: used bootstrap method from ladder

This commit is contained in:
Daniel Ledda
2022-05-28 19:40:07 +02:00
parent 9224cea4dc
commit ebe322dd15
3 changed files with 16 additions and 21 deletions

View File

@@ -4,8 +4,8 @@
"description": "Drum beat visualiser and editor",
"main": "src/main.ts",
"scripts": {
"build": "webpack",
"dev": "webpack-dev-server"
"build": "vite build",
"dev": "vite"
},
"repository": {
"type": "git",

View File

@@ -1,20 +1,15 @@
import RootView from "@/ui/Root/RootView";
import "@/ui/global.css";
import { bootstrap } from "@djledda/ladder";
const appNode = document.querySelector("#app");
if (appNode) {
try {
const appRoot = new RootView({
orientation: "vertical",
title: "Drum Slayer",
});
window.appRoot = appRoot;
appNode.appendChild(appRoot.render());
console.log("OK!");
} catch (e) {
console.error("FUCK!", e);
}
} else {
console.error("FUCK!");
try {
const appRoot = new RootView({
orientation: "vertical",
title: "Drum Slayer",
});
window.appRoot = appRoot;
bootstrap(appRoot, "app");
console.log("OK!");
} catch (e) {
console.error("FUCK!", e);
}

View File

@@ -3,8 +3,8 @@ import { defineConfig } from "vite";
export default defineConfig({
resolve: {
alias: {
'@': '/src',
'assets': '/assets',
"@": "/src",
"assets": "/assets",
}
},
});