Nuxt instance in Module is undefined nuxt3 stable

In RC 13 I could access the this.nuxt property. But now the same "this" call is undefined.

Does anyone know how to call access the Nuxt property to setup a hook?

~/modules/material-design-icons
import { resolve } from 'path'

const icons = ["ChevronRight", "ChevronDown"];

export default function () {
    this.nuxt.hook("components:dirs", (dirs) => {
        dirs.push({
            path: resolve("node_modules/vue-material-design-icons"),
            prefix: "MaterialIcon",
            pattern: `**/@(${icons.join("|")}).vue`
        });
    });
}
Was this page helpful?