Skip to content

how to use imports in nuxt.config.ts via paths ? #15202

@m0dch3n

Description

@m0dch3n

Environment

Nuxi 3.0.0-rc.10 14:35:32
RootDir: /home/workspace/app/packages/app/web 14:35:33
Nuxt project info: 14:35:33


  • Operating System: Linux
  • Node Version: v18.9.1
  • Nuxt Version: 3.0.0-rc.10
  • Nitro Version: 0.5.3
  • Package Manager: npm@8.19.1
  • Builder: vite
  • User Config: -
  • Runtime Modules: -
  • Build Modules: -

Reproduction

import { createBackendConfig } from '@mypath/common-api/config/backendConfig' in your nuxt.config.ts

Describe the bug

Will result in:

ERROR Cannot start nuxt: Cannot find module '@mypath/common-api/config/backendConfig'

Which is obvious because, it doesn't know @mypath in the context of nuxt.config.ts

In Vite I can define this for vite.config.ts in tsconfig.node.json because this tsconfig is responsible for the vite.config.ts due to "include": ["vite.config.ts", "./vite.ts"],

How do I do in nuxt environment for nuxt.config.ts ?

Additional context

No response

Logs

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions