Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

feat(nuxt3): extends support for server/ directory #3673

Merged
merged 1 commit into from
Mar 15, 2022
Merged

Conversation

kevinmarrec
Copy link
Contributor

@kevinmarrec kevinmarrec commented Mar 15, 2022

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

Following up nuxt/nuxt#13367 (extends support progress) this PR allows extending server/ directory for extended config layers

TO DO

  • Extends support for server directory
  • Improve code to have less redundant logic ?
  • Extends support for serverMiddleware config key in layers => maybe later ? /cc @pi0

@kevinmarrec kevinmarrec requested a review from pi0 March 15, 2022 16:03
@netlify
Copy link

netlify bot commented Mar 15, 2022

βœ”οΈ Deploy Preview for nuxt3-docs canceled.

πŸ”¨ Explore the source changes: cbf6b68

πŸ” Inspect the deploy log: https://app.netlify.com/sites/nuxt3-docs/deploys/6230b8f0fd08910009bce6a3

@pi0 pi0 merged commit 227ceed into main Mar 15, 2022
@pi0 pi0 deleted the extends-server branch March 15, 2022 16:15
@pi0
Copy link
Member

pi0 commented Mar 15, 2022

This is an experimental feature and probably chaning little bit behavior when switcing to nitropack.

@yassilah
Copy link
Contributor

Hi! I love the new extends feature of Nuxt 3 and I'm really amazed by the possibilities it offers. However, when it comes to extending the server directory, I would also expect it to be possible for an "upper" layer to override a "lower" layer with default handlers. Right now, because of the order of the scanDirs, it isn't possible; though I found a quick workaround by enforcing it manually. Maybe this should be the default behavior?

useNuxt().hook('nitro:init', nitro => {
    nitro.hooks.hook('rollup:before', nitro => {
        nitro.options.scanDirs.reverse()
    })
})

@danielroe danielroe added the 3.x label Jan 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants