How can I access a JS API exposed by a Nuxt module from a client-side plugin?
Situation: I am utilizing Buefy/Bulma, which is implemented in nuxt.config.js like this:
modules: [
['nuxt-buefy', {css: false}],
],
Buefy provides this.$buefy.<etc>
accessible from components.
However, I am interested in accessing this API from within a client-side plugin, specifically utils.js, configured as follows:
plugins: ['~/plugins/utils.js'],
And the content of utils.js:
export default ({app}, inject) => {
inject('myUtil', (msg, isErr) => {
app.$buefy; //<-- undefined
....
I suspect it may be an ordering issue, perhaps Buefy is loaded after my plugin. Using a static JS file loaded via meta.scripts
will not work as it lacks access to the app (I presume).
Is there any solution available for this situation?