Skip to content

[Bug?]: Vite doesn't support ts path aliases #8666

@bnn1

Description

@bnn1

What's not working?

Redwood.js relies on tsconfig path aliases. Vite doesn't support path aliases out of the box. One need to install the vite-tsconfig-paths vite plugin and add it to the vite configuration to allow usage of path aliases.

// rest imports
import tsconfigPaths from 'vite-tsconfig-paths'
// rest config
const viteConfig: UserConfig = {
  plugins: [redwood(), tsconfigPaths()],
}

export default defineConfig(viteConfig)

It would be good to at least mention the additional steps required for vite to work when setting up vite.

How do we reproduce the bug?

  1. yarn rw setup vite && yarn rw dev
  2. add import using path alias in any web workspace component
  3. see error

What's your environment? (If it applies)

No response

Are you interested in working on this?

  • I'm interested in working on this

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug/confirmedWe have confirmed this is a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions