File tree Expand file tree Collapse file tree 3 files changed +8
-4
lines changed
example/2-client-component Expand file tree Collapse file tree 3 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -2,14 +2,14 @@ import { Hono } from "hono";
22import { serveStatic } from "hono/bun" ;
33import { build } from "plainstack/bun" ;
44import { render } from "plainstack/client" ;
5- import { Counter } from "./counter" ;
5+ import { Counter } from "./client/ counter" ;
66
77const app = new Hono ( ) ;
88
99app . use ( "/static/*" , serveStatic ( { root : "./example/2-client-component" } ) ) ;
1010
1111await build ( {
12- entrypoints : [ "example/2-client-component/counter.tsx" ] ,
12+ entrypoints : "example/2-client-component/client" ,
1313 outdir : "example/2-client-component/static" ,
1414} ) ;
1515
File renamed without changes.
Original file line number Diff line number Diff line change 11import { Database } from "bun:sqlite" ;
22import { randomBytes } from "node:crypto" ;
33import { readdir } from "node:fs/promises" ;
4+ import { join } from "node:path" ;
45import type { BuildConfig as BunBuildConfig } from "bun" ;
56import { CamelCasePlugin , Kysely } from "kysely" ;
67import { BunSqliteDialect } from "kysely-bun-sqlite" ;
@@ -46,12 +47,15 @@ type BuildConfig = Omit<BunBuildConfig, "entrypoints"> & {
4647export async function build ( options : BuildConfig ) {
4748 const entrypointfiles =
4849 typeof options . entrypoints === "string"
49- ? await readdir ( options . entrypoints )
50+ ? await readdir ( options . entrypoints ) . then ( ( files ) =>
51+ files . map ( ( file ) => join ( options . entrypoints as string , file ) ) ,
52+ )
5053 : options . entrypoints ;
54+ console . log ( entrypointfiles ) ;
5155 return await Bun . build ( {
5256 outdir : "static" ,
5357 sourcemap : "linked" ,
54- minify : false , // TODO
58+ minify : prod ( ) ,
5559 ...options ,
5660 entrypoints : entrypointfiles ,
5761 } ) ;
You can’t perform that action at this time.
0 commit comments