microcipcip/cookie-universal

Support top-level options

mrleblanc101 opened this issue · 0 comments

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