Skip to content

Commit

Permalink
update docs for blitz.config.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
flybayer committed Apr 29, 2021
1 parent 4524161 commit bf793f8
Showing 1 changed file with 8 additions and 16 deletions.
24 changes: 8 additions & 16 deletions app/pages/docs/blitz-config.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,8 @@ title: blitz.config.js
sidebar_label: blitz.config.js
---

You can customize advanced behavior of Blitz with `blitz.config.js`.

`blitz.config.js` is a regular Node.js module, not a JSON file. It gets
used by the Blitz server and build phases, and it's not included in the
browser build.
You can customize advanced behavior of Blitz with `blitz.config.js` or
`blitz.config.ts`.

Take a look at the following `blitz.config.js` example:

Expand All @@ -33,7 +30,7 @@ can see the available phases
Phases can be imported from `next/constants`:

```js
const {PHASE_DEVELOPMENT_SERVER} = require("next/constants")
import {PHASE_DEVELOPMENT_SERVER} from "next/constants"

module.exports = (phase, {defaultConfig}) => {
if (phase === PHASE_DEVELOPMENT_SERVER) {
Expand All @@ -57,10 +54,6 @@ understand what each config does, instead, search for the features you
need to enable or modify in this section and they will show you what to
do.

> Avoid using new JavaScript features not available in your target Node.js
> version. `blitz.config.js` will not be parsed by Webpack, Babel or
> TypeScript.
## Webpack Config {#webpack-config}

You can customize the Blitz webpack config. See
Expand Down Expand Up @@ -93,9 +86,6 @@ module.exports = {
}
```

> Deployments to [Vercel](https://vercel.com) will automatically enable
> this target. You should not opt-into it yourself.
## Middleware {#middleware}

HTTP middleware can be added queries and mutations.
Expand Down Expand Up @@ -144,8 +134,9 @@ module.exports = {
### Proxy support {#proxy-support}
Proxy support is enabled automatically for recipe install if either `http_proxy` or `https_proxy`
environment variable is present. You can also set proxy using:
Proxy support is enabled automatically for recipe install if either
`http_proxy` or `https_proxy` environment variable is present. You can
also set proxy using:
```js
module.exports = {
Expand All @@ -157,7 +148,8 @@ module.exports = {
}
```
Please note that proxy configuration in `blitz.config.js` will override environment proxy configuration.
Please note that proxy configuration in `blitz.config.js` will override
environment proxy configuration.
## CDN Support with Asset Prefix {#cdn-support-with-asset-prefix}
Expand Down

0 comments on commit bf793f8

Please sign in to comment.