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

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

Merged
merged 4 commits into from
Jul 12, 2022

Conversation

danielroe
Copy link
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
module.cjs Outdated Show resolved Hide resolved
@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