gramjs icon indicating copy to clipboard operation
gramjs copied to clipboard

How to run on angular browser

Open seng1 opened this issue 3 years ago • 4 comments

How to run on angular browser

seng1 avatar Feb 11 '22 12:02 seng1

you can use webpack to create a dist file (clone this repo and just run webpack) and then you import it like any other file.

painor avatar Feb 11 '22 12:02 painor

@painor But how to get types for bundle ? defines.d.ts has relative path inside ...

redradist avatar Mar 08 '22 12:03 redradist

@redradist you cannot get types for the bundle right now.

But if your project which uses GramJS uses Webpack itself, you can just install it with npm i telegram and develop easily with types. After building your project, GramJS gets bundle with it.

rojvv avatar Mar 08 '22 15:03 rojvv

Hi @roj1512, Sorry for the possibly dumb question for you. I'm also interested in using gramjs with Angular in the browser. But I don’t understand how exactly I should proceed in order to use types and have the project build without errors.

I have already built a separate telegram.js file from the gramjs project using the webpack command. Linking this file to the project seems to prevent the types from being used. And if I execute the command npm i telegram, the project will not build.

Could you describe step by step, please, what to do in this situation?

yegor-pelykh avatar Sep 08 '23 14:09 yegor-pelykh