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

cannot import individual functions (in vite) #55

Closed
scarf005 opened this issue Nov 28, 2022 · 1 comment
Closed

cannot import individual functions (in vite) #55

scarf005 opened this issue Nov 28, 2022 · 1 comment

Comments

@scarf005
Copy link

scarf005 commented Nov 28, 2022

image

tried solution at #18, but there seems to be problems:

repro at: https://stackblitz.com/edit/vitejs-vite-8d4ao8?file=src/main.tsx

@mobily mobily added bug Something isn't working feature request and removed bug Something isn't working labels Nov 29, 2022
@mobily
Copy link
Owner

mobily commented Nov 29, 2022

@scarf005 added in v4.0.0-rc.1, keep in mind that all paths values are relative to baseUrl (docs: https://www.typescriptlang.org/tsconfig#paths), therefore in your case (using the latest version), it should be:

"baseUrl": "./src",
"paths": {
  "@mobily/ts-belt/*": ["../node_modules/@mobily/ts-belt/dist/types/*"]
}

I will update the docs to cover this case :)

demo: https://stackblitz.com/edit/vitejs-vite-evwcxk?file=src/App.tsx

@mobily mobily closed this as completed Nov 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants