docs: add bridge scripts change (#1155)

This commit is contained in:
Daniel Roe 2021-10-18 14:54:55 +01:00 committed by GitHub
parent 9357d0895d
commit 93454c1fa0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -51,6 +51,35 @@ npm install -D @nuxt/bridge@npm:@nuxt/bridge-edge
```
::
### Update your scripts
You will also need to update your scripts within your `package.json` to reflect the fact that Nuxt will now produce a Nitro server as build output.
#### Static target
If you have set `target: 'static'` in your `nuxt.config` then you need to ensure that you update your build script to be `nuxt generate`.
```json
{
"scripts": {
"build": "nuxt generate"
}
}
```
#### Server target
For all other situations, you can use the normal `nuxt build` command.
```json
{
"scripts": {
"build": "nuxt build",
"start" "node .output/server/index.mjs"
}
}
```
### Update `nuxt.config`
Please make sure to avoid any CommonJS syntax such as `module.exports`, `require` or `require.resolve` in your config file. It will soon be deprecated and unsupported.