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

Support top-level options #152

Open
mrleblanc101 opened this issue May 5, 2023 · 0 comments · May be fixed by #154
Open

Support top-level options #152

mrleblanc101 opened this issue May 5, 2023 · 0 comments · May be fixed by #154

Comments

@mrleblanc101
Copy link

mrleblanc101 commented May 5, 2023

Nuxt has 2 way to pass options to a module.

A) Directly to the module like so:

export default {
  modules: [['cookie-universal-nuxt', { option1: true, option2: true }]],
}

B) Or via an option inside the nuxt config:

export default {
  cookieUniversal: {
    option1,
    option2
  }
}

Would be nice to support the second option which is cleaner for big config.
It's only one line of code to change, where moduleOptions is A) and this.options.cookieUniversal is B).

const options = Object.assign({}, this.options.cookieUniversal, moduleOptions)

Link to the docs: https://nuxtjs.org/docs/directory-structure/modules/#2-thisoptions

mrleblanc101 added a commit to mrleblanc101/cookie-universal that referenced this issue May 5, 2023
@mrleblanc101 mrleblanc101 linked a pull request May 5, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant