Nuxt components from layers are not typed

385 Views Asked by At

I have a Nuxt monorepo.

Applications are into a apps folder and layers into a layers folder I have two layers, layer1 and layer2. And two apps app1 and app2.

apps
| app1
| app2
layers
| layer1
| layer2

The layer2 is extending the layer1. Inside the layer2, components auto-imported from the layer1 are rightfully typed.

However app1 and app2 are both extending layer1 and layer2. But inside the apps, only methods used into <script> are auto-imported and typed but components used into <template> are not typed.

Below, an example of a nuxt.config.ts of one of the app

export default defineNuxtConfig({
  extends: ['../../layers/layer1', '../../layers/layer2'],
  app: {
    head: {
      ...
    },
  },
  runtimeConfig: {
     ...
  },
  components: {
    dirs: [
      {
        path: '~/components',
        pathPrefix: false,
      },
    ],
  },
  typescript: {
    shim: false,
    includeWorkspace: true,
  },
  build: {
    transpile: [...],
  },
  modules: [...],
  // ... other config related to modules
})

The applications are working correctly but the question is why components auto-imported are not typed?

0

There are 0 best solutions below