Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Host a version of the js code somewhere #13

Closed
erikdubbelboer opened this issue Oct 29, 2022 · 2 comments · Fixed by #60
Closed

Host a version of the js code somewhere #13

erikdubbelboer opened this issue Oct 29, 2022 · 2 comments · Fixed by #60

Comments

@erikdubbelboer
Copy link
Member

Not every game uses a build flow that can handle an npm module. Some games require a simple script that they can either bundle with their game (PlayCanvas for example), or that they can include using a <script> tag.

@afrokick
Copy link
Contributor

afrokick commented Sep 24, 2023

For development cases:

<script>
      import("https://esm.sh/@poki/netlib@0.0.10?bundle").then(e=>{
        console.log(e.default);
        const Network = e.default.Network;
      })
</script>

@erikdubbelboer
Copy link
Member Author

erikdubbelboer commented Sep 26, 2023

I think this should also work now:

<script src="https://unpkg.com/@poki/netlib@0.0.12/dist/legacy.js"></script>

For production build you should of course always use either the npm package or for engines like PlayCanvas download this file and include it into your build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants