Skip to content

fix: set nuxt context and normalise config as first module#397

Merged
danielroe merged 4 commits intomainfrom
fix/normalize-first
Jul 12, 2022
Merged

fix: set nuxt context and normalise config as first module#397
danielroe merged 4 commits intomainfrom
fix/normalize-first

Conversation

@danielroe
Copy link
Copy Markdown
Member

@danielroe danielroe commented Jul 9, 2022

🔗 Linked issue

❓ 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

Currently bridge module runs last (to ensure hooks are registered first) but it should probably normalize the config first. This PR adds a stub module to set nuxt context, set bridge option, and normalize layers.

Here's an example of a config that now works but previously didn't:

import { defineNuxtConfig } from '@nuxt/bridge'
import { useNuxt } from '@nuxt/kit'

export default defineNuxtConfig({
  buildModules: [
    function () {
      const nuxt = useNuxt()
    }
  ]
})

📝 Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@danielroe danielroe added the bug Something isn't working label Jul 9, 2022
@danielroe danielroe requested a review from pi0 July 9, 2022 08:56
@danielroe danielroe self-assigned this Jul 9, 2022
Comment thread module.cjs Outdated
@danielroe danielroe merged commit 9be3a44 into main Jul 12, 2022
@danielroe danielroe deleted the fix/normalize-first branch July 12, 2022 09:20
@danielroe danielroe mentioned this pull request Jun 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant