Skip to content

Support top-level options #152

@mrleblanc101

Description

@mrleblanc101

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions