Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Vite to serve and build server code. Fixes build. #824

Merged
merged 2 commits into from
Jul 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file removed .env
Empty file.
1 change: 1 addition & 0 deletions .env.server
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
NODE_ENV=production
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
/coverage

# production
/build
/server.bundle.js
/dist

# misc
.DS_Store
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,17 +91,17 @@ If you get port conflict errors, make sure to stop other instances of the Fireba

Builds the app for production, both server and web.

The web production build will be output to the `build` folder.<br />
The web production build will be output to the `dist/client` folder.<br />
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.<br />

The server code will be packed into `server.bundle.js`, which is a standalone
JS file including all dependencies, ready for execution with Node.js.
The server code will be packed into `dist/server/server.js`, which is a
standalone JS file including all dependencies, ready for execution with Node.js.

To run the production build with emulators, use:

```bash
firebase emulators:exec --project sample --only database,firestore --import test-data 'PORT=3000 node server.bundle.js'
firebase emulators:exec --project demo-example --import test-data 'node dist/server/server.js'
```

This will start a server that serves both the static files and APIs at `http://localhost:3000/`.
Expand Down
Loading