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

missing static option in docs #1524

Open
Barbapapazes opened this issue Aug 3, 2023 · 3 comments
Open

missing static option in docs #1524

Barbapapazes opened this issue Aug 3, 2023 · 3 comments
Labels
documentation Improvements or additions to documentation

Comments

@Barbapapazes
Copy link
Member

Environment

/

Reproduction

/

Describe the bug

Hello,

In the configuration of the documentation, https://nitro.unjs.io/config, there is nothing related to a static option.

But as I can see here,

detectTarget({ static: options.static });
, or in this comment, nuxt/nuxt#22471 (comment), this option is mapped to the static preset, https://github.com/unjs/nitro/blob/main/src/presets/static.ts.

We are mentioning it in the Nuxt documentation so having a link in the Nitro documentation would be appreciated!

Thanks

Additional context

No response

Logs

No response

@pi0 pi0 added documentation Improvements or additions to documentation and removed pending triage labels Aug 3, 2023
@pi0 pi0 changed the title Missing static option in API missing static option in docs Aug 3, 2023
@pi0
Copy link
Member

pi0 commented Aug 3, 2023

Thanks for notice. Since we introduce it as an internal flag, initially didn't document. Feel free to make a PR to add docs 👍🏼 (also there might be more of this missing API docs)

@Barbapapazes
Copy link
Member Author

Barbapapazes commented Aug 12, 2023

I was documenting but I found that the static option does not have the same behavior as the preset: 'static'.

I set up static: true in my config.

esteban@DESKTOP-HHLH0C1:~/dev/unjs/nitro$ nr dev:build

> nitropack@2.5.2 dev:build /home/esteban/dev/unjs/nitro
> pnpm nitro build playground


> nitropack@2.5.2 nitro /home/esteban/dev/unjs/nitro
> jiti ./src/cli/cli.ts "build" "playground"

undefined node-server true
static
static
✔ Generated public playground/.output/public                                                                                                                                                                                                            nitro 7:35:15 AM
✔ You can preview this build using node playground/.output/server/index.mjs                                                                                                                                                                             nitro 7:35:15 AM
esteban@DESKTOP-HHLH0C1:~/dev/unjs/nitro$ NITRO_PRESET=static nr dev:build

> nitropack@2.5.2 dev:build /home/esteban/dev/unjs/nitro
> pnpm nitro build playground


> nitropack@2.5.2 nitro /home/esteban/dev/unjs/nitro
> jiti ./src/cli/cli.ts "build" "playground"

undefined node-server true
static
static
✔ Generated public playground/.output/public                                                                                                                                                                                                            nitro 7:35:21 AM
ℹ Initializing prerenderer                                                                                                                                                                                                                              nitro 7:35:21 AM
false node-server false
nitro-prerender
nitro-prerender
ℹ Prerendering 1 initial routes with crawler                                                                                                                                                                                                            nitro 7:35:22 AM
  ├─ / (8ms)                                                                                                                                                                                                                                             nitro 7:35:22 AM
✔ You can preview this build using npx serve playground/.output/public     

@Barbapapazes
Copy link
Member Author

It's like the static preset was not apply on config. Maybe it's the intended behavior but it looks strange.

esteban@DESKTOP-HHLH0C1:~/dev/unjs/nitro$ nr dev:build

> nitropack@2.5.2 dev:build /home/esteban/dev/unjs/nitro
> pnpm nitro build playground


> nitropack@2.5.2 nitro /home/esteban/dev/unjs/nitro
> jiti ./src/cli/cli.ts "build" "playground"

undefined node-server true
static
static
✔ Generated public playground/.output/public                                                                                                                                                                                                            nitro 7:39:34 AM
{
  concurrency: 1,
  interval: 0,
  failOnError: false,
  crawlLinks: false,
  ignore: [],
  routes: []
}
✔ You can preview this build using node playground/.output/server/index.mjs                                                                                                                                                                             nitro 7:39:34 AM
esteban@DESKTOP-HHLH0C1:~/dev/unjs/nitro$ NITRO_PRESET=static nr dev:build

> nitropack@2.5.2 dev:build /home/esteban/dev/unjs/nitro
> pnpm nitro build playground


> nitropack@2.5.2 nitro /home/esteban/dev/unjs/nitro
> jiti ./src/cli/cli.ts "build" "playground"

undefined node-server true
static
static
✔ Generated public playground/.output/public                                                                                                                                                                                                            nitro 7:39:38 AM
{
  concurrency: 1,
  interval: 0,
  failOnError: false,
  crawlLinks: true,
  ignore: [],
  routes: []
}
ℹ Initializing prerenderer                                                                                                                                                                                                                              nitro 7:39:38 AM
false node-server false
nitro-prerender
nitro-prerender
ℹ Prerendering 1 initial routes with crawler                                                                                                                                                                                                            nitro 7:39:39 AM
  ├─ / (8ms)                                                                                                                                                                                                                                             nitro 7:39:39 AM
✔ You can preview this build using npx serve playground/.output/public      

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants