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

Update node.js import to make them es compatible #1159

Merged
merged 1 commit into from
Oct 4, 2023

Conversation

Kurtil
Copy link
Contributor

@Kurtil Kurtil commented Oct 4, 2023

While testing new stuffs on the repo, I use to test examples with a web server (vscode live server) while updating the import of the xeokit sdk from dist to src. However, a lot of import are not web compatible but node.js compatible. Because of that, it is a pain to serve the examples without a bundler.

This PR aims to ensure the maximum of import are web compatible (some of theme like html2canvas needs to be processed by a bundler or commented to let the viewer start on the browser with the dev server).

@ghost
Copy link

ghost commented Oct 4, 2023

👇 Click on the image for a new way to code review

Review these changes using an interactive CodeSee Map

Legend

CodeSee Map legend

@xeolabs xeolabs added this to the 2.4.0 milestone Oct 4, 2023
@xeolabs xeolabs added the enhancement New feature or request label Oct 4, 2023
@xeolabs xeolabs merged commit c4d7fb6 into xeokit:master Oct 4, 2023
@Kurtil Kurtil deleted the core/ES-Imports branch October 4, 2023 21:33
@Kurtil
Copy link
Contributor Author

Kurtil commented Oct 4, 2023

🎉 @xeolabs no need to comment the html2canvas import of the Viewer.js file if the browser supports importmap. I had these lines on the html head of the desired examples and it works perfectly:

    <script type="importmap">
        {
          "imports": {
            "html2canvas/dist/html2canvas.esm.js": "https://cdn.jsdelivr.net/npm/[email protected]/dist/html2canvas.esm.js"
          }
        }
    </script>

Thanks to this PR and the lines above, (+ update the import of the xeokit-sdk from dist to src), it is possible to dev on xeokit with a minimal dev environment (a dev server) ! :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants