mobily / ts-belt

🔧 Fast, modern, and practical utility library for FP in TypeScript.
https://mobily.github.io/ts-belt
MIT License
1.11k stars 31 forks source link

cannot import individual functions (in vite) #55

Closed scarf005 closed 1 year ago

scarf005 commented 1 year ago

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 commented 1 year ago

@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