Describe the bug
When including @dotkomonline/design-system in another project the type-declarations are not available to the project.
To Reproduce
Include @dotkomonline/design-system in a Typescript project
Import something from the package
Use the Component/function/object for something
See that no errors are visible when something is wrong, and that no type-hints are available for auto-completion.
Expected behavior
I expected the modules to be typed.
Additional context
My guess is that this has is because the types are exported with the root-relative paths in the design system.
Example from index.d.ts from the package:
import { colors } from 'common/colors';
This works in the design system itself because of the build steps in webpack, but it does not work when the module is used outside of the design-system project environment.
Manually changing the import to a relative path in ./node_modules/@dotkomonline/design-system/dist/index.d.ts makes it work:
Describe the bug When including
@dotkomonline/design-system
in another project the type-declarations are not available to the project.To Reproduce
@dotkomonline/design-system
in a Typescript projectExpected behavior I expected the modules to be typed.
Additional context My guess is that this has is because the types are exported with the root-relative paths in the design system.
Example from
index.d.ts
from the package:This works in the design system itself because of the build steps in webpack, but it does not work when the module is used outside of the
design-system
project environment.Manually changing the import to a relative path in
./node_modules/@dotkomonline/design-system/dist/index.d.ts
makes it work: