WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Using full-stack Bun app in production #25390

@shadoworion

Description

@shadoworion

What is the type of issue?

Documentation is confusing

What is the issue?

There are some conflicts between the documentation and the example app in the Fullstack Bun app.
It isn't very clear. I don't really understand how I need to use the Fullstack Bun app in production.

If I am using bun init --react=shadcn - I am getting build.ts file, and in package.json it looks like I need to build with this file. In documentation, in this section (https://bun.com/docs/bundler/fullstack#production-build), I see that for production I need to build with this command bun build --target=bun --production --outdir=dist ./server/index.ts.

It looks like build.ts from the "init" bundle builds only the frontend and skips the bun server, because it outputs dynamic chunks with index.html but no index.js I can use as an entry point.

Also in "init" bundle, I see a command to start the app in production with NODE_ENV=production bun src/index.ts - so without compiling to JS in prod? In documentation, it's - NODE_ENV=production bun dist/index.js.

Then I saw a different project structure between the "init" bundle and the documentation. It's also confusing. I don't understand what the latest recommendation is; it's not only about structure, it's also about files.

For example:
In the "init" bundle, everything in the "src" folder and in the documentation is separated into "src" (for React), "public" (for HTML/assets), and "server" (for the API).

In the "init" bundle, we import React in index.html in the <header>. In documentation, it's in <body> after the root.
In the "init" bundle, we import styles inside React in App.tsx. In the documentation, it's in the <header> of index.html.

I want to build a full-stack Bun app with React+Shadcn for AWS AppRunner (with Docker)

Where did you find it?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions