DEV Community


CDN and TypeScript support (also JavaScript typing for IDE)

patarapolw profile image Pacharapol Withayasakpunt ・1 min read

This is quite easy. You will need cdn.d.ts, but you will also need to install the module in package.json, (or at least @types/), no matter what.

declare module '*' {
  export * from 'js-yaml'
Enter fullscreen mode Exit fullscreen mode

Also, I am consider if cdn.d.ts file can be generated programmatically? (Next.js also generate typings for CSS modules on the fly.)

It would be nice if I can use Deno for Skypack CDN, but it seems that it does not have web-browser-related typings.

Or, do have have a better way?


Editor guide
patarapolw profile image
Pacharapol Withayasakpunt Author

tsconfig.json / jsconfig.json path aliases might be a much much easier option.

mzaini30 profile image

I've never tried deno. maybe, I'll try later.