Skip to content

[Question] Self-Hosting instead of unpkg #217

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

Open
LindezaGrey opened this issue Mar 20, 2023 · 1 comment
Open

[Question] Self-Hosting instead of unpkg #217

LindezaGrey opened this issue Mar 20, 2023 · 1 comment

Comments

@LindezaGrey
Copy link

Hi there sorry to bother you but i can't get my head around the fact how this is hosted on unpkg.com and how i can clone and self-host this library. i would like to do some changes on the styling. Can you give me a quick hint about the steps i should take?
I saw that the bundle.js is also published to github-pages. Could it be imported like this:

script: https://workadventure.github.io/scripting-api-extra/bundle.js

instead of:
script: https://unpkg.com/@workadventure/scripting-api-extra@^1/dist/bundle.js

i already tried to install the library in my project like so:
npm install --save git+https://github.com/workadventure/scripting-api-extra.git

but i get errors - i guess because the map-starter-kit uses vite while here we are using webpack.

Anyways, my main question:
How can i tell workadventure (self-hosted) to not load from unpkg.com but my version? Ideally hosted with github pages. Just a few hints in the right direction would be really appreciated. thanks a lot!

@moufmouf
Copy link
Collaborator

Hey @LindezaGrey ,

I'm answering quite late here, sorry. Yes, unpkg is really a pain in the *ss...

When designing the lib, I planned a "assetsUrl" variable that can be used to switch to another URL. See: https://github.com/workadventure/scripting-api-extra/blob/main/src/Features/doors.ts#L188

I've never really tried to use it. My issue is that it is hard to expose HTML files from node_modules to the public folder (given the number of different bundlers that exist). Maybe switching to Vite and providing a Vite plugin could be a solution...

Anyway, if you have a luminous idea on how to solve this, I'm all ears.

@moufmouf moufmouf reopened this Aug 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants