NuxtJS not registering/using custom module

Viewed 138

So I am trying to build my custom NuxtJS module. So far I've read the docs, looked at some existing real packages, and followed these:

This is my simple code located in modules/pauth/index.js

export default function () {
  // const { nuxt } = this
  console.log('robert modules')

}

I have tried different variations I could find online but nothing seems to be working. The project compiles fine, and there is no errors.

If I make a typo in the name of module in nuxt.config.js it will give me an error, which means it is actually seeing my module.

This is my config file (part of it):

  // Modules (https://go.nuxtjs.dev/config-modules)
  modules: [
    '@nuxtjs/laravel-echo',
    '@nuxtjs/axios',
    'vue-social-sharing/nuxt',
    '@nuxt/image',
    'vue-scrollto/nuxt',
    '@nuxtjs/moment',
    '~/modules/pauth',
  ],

I am expecting to see my console.log but nothing seems to happen. It's like it's ignored or something. I also tried to inspect the NuxtJS instance in the browser but I did not see my module there.

I am also constantly rebuilding with npm run dev.

What am I doing wrong?

0 Answers
Related