Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
1 task
bnn1 opened this issue Jun 20, 2023 · 0 comments · Fixed by #9574
Closed
1 task

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

bnn1 opened this issue Jun 20, 2023 · 0 comments · Fixed by #9574
Labels
bug/confirmed We have confirmed this is a bug

Comments

@bnn1
Copy link
Contributor

bnn1 commented Jun 20, 2023

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
@bnn1 bnn1 added the bug/needs-info More information is needed for reproduction label Jun 20, 2023
@dac09 dac09 added bug/confirmed We have confirmed this is a bug and removed bug/needs-info More information is needed for reproduction labels Nov 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/confirmed We have confirmed this is a bug
Projects
None yet
2 participants