bundle js

This commit is contained in:
Chris Wanstrath 2025-10-01 10:12:05 -07:00
parent b411ce7013
commit 1d6a7bc0c1
4 changed files with 1119 additions and 5 deletions

View File

@ -4,10 +4,13 @@
"type": "module",
"private": true,
"scripts": {
"start": "bun src/server.tsx",
"runner": "env NODE_ENV=production bun run src/runner.ts",
"prod": "env NODE_ENV=production bun src/server.tsx",
"dev": "env BUN_HOT=1 bun --hot src/server.tsx",
"start": "bun src/server.tsx",
"prod": "env NODE_ENV=production bun src/server.tsx",
"build": "./scripts/build.sh",
"runner": "env NODE_ENV=production bun run src/runner.ts",
"deploy": "./scripts/deploy.sh",
"push": "./scripts/deploy.sh",
"remote:install": "./scripts/remote-install.sh",
@ -21,4 +24,4 @@
"dependencies": {
"kleur": "^4.1.5"
}
}
}

1110
public/bundle.js Normal file

File diff suppressed because it is too large Load Diff

View File

@ -12,7 +12,7 @@ export const Layout: FC = async ({ children, title }) => (
<link href="/css/game.css" rel="stylesheet" />
<script type="importmap" dangerouslySetInnerHTML={{ __html: `{ "imports": { "@/": "/" } }` }} />
<script src="/js/main.js" type="module" async></script>
<script src={process.env.NODE_ENV === "production" ? "/bundle.js" : "/js/main.js"} type="module" async></script>
</head>
<body data-mode="tall">
<main>

View File

@ -30,6 +30,7 @@ const app = new Hono()
app.use("*", prettyJSON())
app.use('/*', serveStatic({ root: './public' }))
app.use('/img/*', serveStatic({ root: './public' }))
app.use('/vendor/*', serveStatic({ root: './public' }))
app.use('/css/*', serveStatic({ root: './src' }))