Rather than just requiring a string, would it also be possible to pass options to the plugin upon install? Or at the least, passing a function or object, instead of a string path, as a Nuxt plugin.
for example:
// module.js
this.addPlugin({ src: 'somePath', options: { msg: 'hello' } })
// plugin.js
export default (ctx, opts) => {
opts.msg // hello
}
Or:
this.addPlugin((ctx) => {
....
})
Modules are useful to configure the Nuxt build, but plugins give access to the Nuxt instance. Except without the ability to pass options, they're only useful for hooking simple Vue plugins to Nuxt.
<!--cmty--><!--cmty_prevent_hook--><div align="right"><sub><em>This feature request is available on <a href="https://nuxtjs.cmty.io">Nuxt.js</a> community (<a href="https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c859">#c859</a>)</em></sub></div>