Setup absolute paths in Vite/TS config
This commit is contained in:
parent
e595cc1135
commit
4c05c872b6
18
src/App.tsx
18
src/App.tsx
|
|
@ -1,16 +1,14 @@
|
|||
import { createShapeId, TLUiComponents } from "@tldraw/tldraw";
|
||||
import "@tldraw/tldraw/tldraw.css";
|
||||
import "./css/style.css"
|
||||
import React, { useEffect, useState } from "react";
|
||||
import "@/css/style.css"
|
||||
import React, { } from "react";
|
||||
import ReactDOM from "react-dom/client";
|
||||
import { HTMLShape } from "./ts/shapes/HTMLShapeUtil";
|
||||
import { Default } from "./ts/components/Default";
|
||||
import { Canvas } from "./ts/components/Canvas";
|
||||
import { Toggle } from "./ts/components/Toggle";
|
||||
import { usePhysics } from "./ts/hooks/usePhysics.ts"
|
||||
import { createShapes } from "./utils";
|
||||
import { Default } from "@/ts/components/Default";
|
||||
import { Canvas } from "@/ts/components/Canvas";
|
||||
import { Toggle } from "@/ts/components/Toggle";
|
||||
import { usePhysics } from "@/ts/hooks/usePhysics.ts"
|
||||
import { createShapes } from "@/utils";
|
||||
import { BrowserRouter, Route, Routes } from 'react-router-dom';
|
||||
import { Contact } from "./ts/components/Contact.tsx";
|
||||
import { Contact } from "@/ts/components/Contact.tsx";
|
||||
|
||||
ReactDOM.createRoot(document.getElementById("root")!).render(<App />);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { Tldraw, TLShape, TLUiComponents } from "@tldraw/tldraw";
|
||||
import { SimController } from "../physics/PhysicsControls";
|
||||
import { HTMLShapeUtil } from "../shapes/HTMLShapeUtil";
|
||||
import { SimController } from "@/ts/physics/PhysicsControls";
|
||||
import { HTMLShapeUtil } from "@/ts/shapes/HTMLShapeUtil";
|
||||
|
||||
const components: TLUiComponents = {
|
||||
HelpMenu: null,
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ export function Toggle() {
|
|||
return (
|
||||
<>
|
||||
<button id="toggle-physics" onClick={() => window.dispatchEvent(new CustomEvent('togglePhysicsEvent'))}>
|
||||
<img src="src/assets/gravity.svg" alt="Toggle Physics" />
|
||||
<img src="assets/gravity.svg" alt="Toggle Physics" />
|
||||
</button>
|
||||
</>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,10 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"baseUrl": "./src",
|
||||
"paths": {
|
||||
"@/*": ["*"],
|
||||
"src/*": ["./src/*"],
|
||||
},
|
||||
"target": "ES2020",
|
||||
"useDefineForClassFields": true,
|
||||
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
||||
|
|
@ -21,5 +26,6 @@
|
|||
"noFallthroughCasesInSwitch": true
|
||||
},
|
||||
"include": ["src"],
|
||||
|
||||
"references": [{ "path": "./tsconfig.node.json" }]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,4 +9,9 @@ export default defineConfig({
|
|||
wasm(),
|
||||
topLevelAwait()
|
||||
],
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': '/src',
|
||||
},
|
||||
},
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in New Issue