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

RFC/ENH importmap not supported on some machine #44

Open
Xinyu-Li-123 opened this issue Apr 24, 2024 · 0 comments
Open

RFC/ENH importmap not supported on some machine #44

Xinyu-Li-123 opened this issue Apr 24, 2024 · 0 comments
Labels
type:enhancement New feature or request

Comments

@Xinyu-Li-123
Copy link
Contributor

Xinyu-Li-123 commented Apr 24, 2024

I was testing Deskulpt on a Ubuntu20 virtual machine, and I find that importmap is unsupported by the version of webview I am using. I think we should directly replace @deskult-test/xxx with relative path, instead of relying on importmap to resolve named import. We are already doing this with @deskulpt-test/apis, which is replaced with a blob url, we might as well do it for all default dependencies.

I think we could create a hash map that maps named imports of default dependencies to the corresponding relative path. For example,

{
    "@deskulpt-test/react": "/assets/src/.scripts/react.js",
    "@deskulpt-test/raw-apis": "/assets/src/.scripts/raw-apis.js",
    "@deskulpt-test/apis": "/assets/src/.scripts/apis.js",
}

Based on whether we are building or developing, we can load different maps (what importmapPlugin does currently).

@Charlie-XIAO Charlie-XIAO changed the title RFC importmap not supported on some machine RFC/ENH importmap not supported on some machine Apr 29, 2024
@Charlie-XIAO Charlie-XIAO added the type:enhancement New feature or request label Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants