hatjs icon indicating copy to clipboard operation
hatjs copied to clipboard

It's not possible to use this library as a typescript module

Open denisfalqueto opened this issue 2 years ago • 1 comments

I'm trying to use this library in a Vite build, with vanillajs template, using typescript. If I npm install this library, I can't import it in this way:

import { Hat } from 'hatjs';
tsc && vite build

gies:


> [email protected] build
> tsc && vite build

src/main.ts:1:21 - error TS2307: Cannot find module 'hatjs' or its corresponding type declarations.

1 import { Hat } from 'hatjs';
                      ~~~~~~~

What struck me as funny is that I can use RawJS in that same way without any problems.

denisfalqueto avatar Jan 12 '24 10:01 denisfalqueto

Thanks for the report. I'll get on this. I don't use modules myself, so I was waiting for someone to request this before adding support.

paul-go avatar Jan 12 '24 15:01 paul-go