Relative Content

Tag Archive for reactjstypescriptcdn

Is there a way to import an cdn file that has no npm package to react/vite?

I would like to install a library for animation winds into react. I already installed leaflet which is not meant for React but this one has an npm package and I kinda did it but this windy.com lib is a pure js source code and some things I tried with webpack or vite didn’t work. I would like some pointers on where to look since I am having a hard time understanding how this works.

How can I suppress React imports in TypeScript output to allow CDN references?

I am trying to use CDN URLs to reference the react and react-dom libraries in my typescript app. I do not want to bundle them into my compiled .js file, as I’m concerned with performance in production. But there seems no straightforward way to achieve this without manually editing the compiled .js file to remove the import references. See this minimal repro (https://jsfiddle.net/grm6ze1b/):