cleaner imports
This commit is contained in:
parent
a9ea29287e
commit
40b5bb3df3
|
|
@ -4,7 +4,7 @@
|
||||||
export const game = true
|
export const game = true
|
||||||
|
|
||||||
import type { GameContext, InputState } from "@/shared/game"
|
import type { GameContext, InputState } from "@/shared/game"
|
||||||
import { rng } from "@/shared/utils.ts"
|
import { rng } from "@/shared/utils"
|
||||||
|
|
||||||
const WIDTH = 960
|
const WIDTH = 960
|
||||||
const HEIGHT = 540
|
const HEIGHT = 540
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
export const game = true
|
export const game = true
|
||||||
|
|
||||||
import type { GameContext, InputState } from "@/shared/game"
|
import type { GameContext, InputState } from "@/shared/game"
|
||||||
import { rng } from "@/shared/utils.ts"
|
import { rng } from "@/shared/utils"
|
||||||
|
|
||||||
const CELL = 20
|
const CELL = 20
|
||||||
const WIDTH = 30
|
const WIDTH = 30
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
export const game = true
|
export const game = true
|
||||||
|
|
||||||
import type { GameContext, InputState } from "@/shared/game"
|
import type { GameContext, InputState } from "@/shared/game"
|
||||||
import { randomElement, randomIndex } from "@/shared/utils.ts"
|
import { randomElement, randomIndex } from "@/shared/utils"
|
||||||
|
|
||||||
const COLS = 10
|
const COLS = 10
|
||||||
const ROWS = 20
|
const ROWS = 20
|
||||||
|
|
|
||||||
|
|
@ -42,10 +42,10 @@ app.use("*", async (c, next) => {
|
||||||
})
|
})
|
||||||
|
|
||||||
app.on("GET", ["/js/:path{.+}", "/shared/:path{.+}"], async c => {
|
app.on("GET", ["/js/:path{.+}", "/shared/:path{.+}"], async c => {
|
||||||
const path = "./src/" + c.req.path.replace("..", ".")
|
let path = "./src/" + c.req.path.replace("..", ".")
|
||||||
|
|
||||||
// path must end in .js or .ts
|
// path must end in .js or .ts
|
||||||
if (!path.endsWith(".js") && !path.endsWith(".ts")) return c.text("File not found", 404)
|
if (!path.endsWith(".js") && !path.endsWith(".ts")) path += ".ts"
|
||||||
|
|
||||||
const ts = path.replace(".js", ".ts")
|
const ts = path.replace(".js", ".ts")
|
||||||
if (isFile(ts)) {
|
if (isFile(ts)) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user