mirror of
https://github.com/nuxt/nuxt.git
synced 2025-02-16 21:58:19 +00:00
docs: add bridge scripts change (#1155)
This commit is contained in:
parent
9357d0895d
commit
93454c1fa0
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user