2021-09-03 13:33:32 -07:00
|
|
|
# Build Configuration
|
|
|
|
|
|
|
|
When compiling Soapbox FE, environment variables may be passed to change the build itself.
|
|
|
|
For example:
|
|
|
|
|
|
|
|
```sh
|
2021-09-05 11:21:39 -07:00
|
|
|
NODE_ENV="production" FE_BUILD_DIR="public" FE_SUBDIRECTORY="/soapbox" yarn build
|
2021-09-03 13:33:32 -07:00
|
|
|
```
|
|
|
|
|
|
|
|
### `NODE_ENV`
|
|
|
|
|
|
|
|
The environment to build Soapbox FE for.
|
|
|
|
|
|
|
|
Options:
|
2021-09-03 15:11:38 -07:00
|
|
|
|
2021-09-03 13:33:32 -07:00
|
|
|
- `"production"` - For live sites
|
|
|
|
- `"development"` - For local development
|
|
|
|
- `"test"` - Bootstraps test environment
|
|
|
|
|
|
|
|
Default: `"development"`
|
|
|
|
|
|
|
|
It's recommended to always build in `"production"` mode for live sites.
|
|
|
|
|
2021-09-03 15:04:41 -07:00
|
|
|
### `BACKEND_URL`
|
|
|
|
|
|
|
|
The base URL for API calls.
|
|
|
|
You only need to set this if Soapbox FE is hosted in a different place than the backend.
|
|
|
|
|
|
|
|
Options:
|
2021-09-03 15:11:38 -07:00
|
|
|
|
2021-09-03 15:04:41 -07:00
|
|
|
- An absolute URL, eg `"https://gleasonator.com"`
|
2021-09-03 15:38:24 -07:00
|
|
|
- Empty string (`""`)`
|
2021-09-03 15:04:41 -07:00
|
|
|
|
2021-09-03 15:38:24 -07:00
|
|
|
Default: `""`
|
2021-09-03 15:04:41 -07:00
|
|
|
|
2021-09-03 13:33:32 -07:00
|
|
|
### `FE_BUILD_DIR`
|
|
|
|
|
|
|
|
The folder to put build files in. This is mostly useful for CI tasks like GitLab Pages.
|
|
|
|
|
|
|
|
Options:
|
2021-09-03 15:11:38 -07:00
|
|
|
|
2021-09-03 13:33:32 -07:00
|
|
|
- Any directory name, eg `"public"`
|
|
|
|
|
|
|
|
Default: `"static"`
|
|
|
|
|
2021-09-05 11:21:39 -07:00
|
|
|
### `FE_SUBDIRECTORY`
|
2021-09-03 13:33:32 -07:00
|
|
|
|
|
|
|
Subdirectory to host Soapbox FE out of.
|
|
|
|
When hosting on a subdirectory, you must create a custom build for it.
|
|
|
|
This option will set the imports in `index.html`, and the basename for routes in React.
|
|
|
|
|
|
|
|
Options:
|
2021-09-03 15:11:38 -07:00
|
|
|
|
2021-09-03 13:33:32 -07:00
|
|
|
- Any path, eg `"/soapbox"` or `"/fe/soapbox"`
|
|
|
|
|
|
|
|
Default: `"/"`
|
|
|
|
|
|
|
|
For example, if you want to host the build on `https://gleasonator.com/soapbox`, you can compile it like this:
|
|
|
|
|
|
|
|
```sh
|
2021-09-05 11:21:39 -07:00
|
|
|
NODE_ENV="production" FE_SUBDIRECTORY="/soapbox" yarn build
|
2021-09-03 13:33:32 -07:00
|
|
|
```
|
2021-09-11 11:51:43 -07:00
|
|
|
|
|
|
|
### `SENTRY_DSN`
|
|
|
|
|
|
|
|
[Sentry](https://sentry.io/) endpoint for this custom build.
|
|
|
|
|
|
|
|
Sentry is an error monitoring service that may be optionally included.
|
|
|
|
When an endpoint is not configured, it does nothing.
|
|
|
|
|
|
|
|
Sentry's backend was FOSS until 2019 when it moved to source-available, but a BSD-3 fork called [GlitchTip](https://glitchtip.com/) may also be used.
|
|
|
|
|
|
|
|
Options:
|
|
|
|
|
|
|
|
- Endpoint URL, eg `"https://abcdefg@app.glitchtip.com/123"`
|
|
|
|
|
|
|
|
Default: `""`
|