Replies: 3 comments 1 reply
-
I tried also using the entry: {
components: 'src/components/index.ts',
}, But it didn't work |
Beta Was this translation helpful? Give feedback.
-
@JaViLuMa did you resolve this issue? |
Beta Was this translation helpful? Give feedback.
-
It's not about the bundler. But it's related to your package entry point. You can create type definition called components.d.ts in root of your package (don't forget to include it when you push your package to npm). // components.d.ts
export * from "./dist/components"; Then add this on your package.json
With this method, both typescript and nodejs will resolve the correct path. import {Route} from "@lunoxjs/core/facades"; // "@lunoxjs/core" is name of my package
import type {Trait} from "@lunoxjs/core/contracts"; |
Beta Was this translation helpful? Give feedback.
-
As the title says, I am having an issue configuring multiple entry points for my React library (TypeScript).
Let's say I have a package named
@my-library
.Inside of it I have the following structure:
src/ ├─ components/ │ ├─ Text/ │ │ ├─ Text.tsx (contains the component itself) │ │ ├─ index.ts (exports the component) │ │ ├─ Text.types.ts (component types) │ ├─ index.ts (exports ALL components, main export file of components folder)
I want to be able to use the library as follows when importing
Text
:But for some reason I can't seem to get it to work besides using it as
@my-library/dist/components
which doesn't work at all anyways sadly...Here is my
babelrc.json
file:My
tsup.config.ts
file:My
package.json
file:And my
tsconfig.json
file:Any help would be much appreciated!!
Beta Was this translation helpful? Give feedback.
All reactions