DEV Community

Discussion on: 3 ways to import node modules in deno

Collapse
 
michaelcurrin profile image
Michael Currin • Edited

I didn't know about the first two approaches.

Yeah third is definitely the best

I use that approach to run a Deno React project using dev.jspm.io for the packages

github.com/MichaelCurrin/react-den...

And that includes a pinned URL for safety.

Additionally, the importing by URL is built into browsers if you do script tag

<script type="module">
  import ReactDOM from "https://dev.jspm.io/react-dom@17.0";
  import React from "https://dev.jspm.io/react@17.0";

  React.useEffect()
</script>
Enter fullscreen mode Exit fullscreen mode

That is demonstrated here in my React app that uses no Deno or Node. Just a frontend

github.com/MichaelCurrin/react-fro...