@bractjs/bractjs 0.1.14 → 0.1.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bin/cli.ts CHANGED
@@ -71,6 +71,9 @@ switch (command) {
71
71
  break;
72
72
 
73
73
  case "build": {
74
+ // Force production so React's conditional exports resolve to the prod
75
+ // server build (react-dom/server.bun production) instead of the dev one.
76
+ if (!process.env.NODE_ENV) process.env.NODE_ENV = "production";
74
77
  const { runBuild } = await import("../src/build/bundler.ts");
75
78
  await runBuild({ port: 3000, appDir: "./app", publicDir: "./public", buildDir: "./build", manifest: { clientEntry: "", routes: {} } });
76
79
  break;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bractjs/bractjs",
3
- "version": "0.1.14",
3
+ "version": "0.1.15",
4
4
  "description": "Production-grade SSR framework for Bun + React 19. File-based routing, streaming SSR, server actions, typed routes.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/bractjs/bractjs#readme",
@@ -33,6 +33,12 @@ export async function runBuild(config: BractJSConfig): Promise<void> {
33
33
  target: "bun",
34
34
  outdir: "build/server",
35
35
  sourcemap: config.sourcemap ?? "external",
36
+ // Force production so Bun picks the `jsx`/`jsxs` runtime instead of
37
+ // `jsxDEV` — `jsxDEV` only exists on react/jsx-dev-runtime, which is a
38
+ // no-op when bundled under NODE_ENV=production, leaving the call site
39
+ // calling an undefined function. Same fix applied to the client bundle
40
+ // implicitly via buildDefines().
41
+ define: { "process.env.NODE_ENV": JSON.stringify("production") },
36
42
  plugins: [useClientStubPlugin],
37
43
  });
38
44
  if (!serverResult.success) throw new AggregateError(serverResult.logs, "Server build failed");
@@ -4,8 +4,8 @@
4
4
  "private": true,
5
5
  "scripts": {
6
6
  "dev": "bractjs dev",
7
- "build": "bractjs build",
8
- "start": "bractjs start"
7
+ "build": "NODE_ENV=production bractjs build",
8
+ "start": "NODE_ENV=production bractjs start"
9
9
  },
10
10
  "dependencies": {
11
11
  "@bractjs/bractjs": "latest",
@@ -0,0 +1,20 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ESNext",
4
+ "module": "ESNext",
5
+ "moduleResolution": "bundler",
6
+ "lib": ["ESNext", "DOM", "DOM.Iterable"],
7
+ "jsx": "react-jsx",
8
+ "jsxImportSource": "react",
9
+ "strict": true,
10
+ "esModuleInterop": true,
11
+ "skipLibCheck": true,
12
+ "allowImportingTsExtensions": true,
13
+ "verbatimModuleSyntax": true,
14
+ "noEmit": true,
15
+ "resolveJsonModule": true,
16
+ "isolatedModules": true,
17
+ "types": ["bun-types", "react", "react-dom"]
18
+ },
19
+ "include": ["app/**/*.ts", "app/**/*.tsx", "bractjs.config.ts"]
20
+ }