google / google/playground-elements
Import Map to Local File
- Dominant language
- TypeScript
- Stars
- 648
- Forks
- 61
- PR merge metrics
- No merged PRs in 30d
Description
:wave: Hello!
I'd like to be able to set up an import map to a 'local' file (local to the playground, that is - meaning a file that the playground includes)
Consider:
```json
{
"files": {
"index.html": {
"content": ""
},
"script.js": {
"content": "import '@x/y/z';"
},
"xyz.js": {
"content": "console.log('hidy-ho');",
"hidden": true
}
},
"importMap": {
"imports": {
"@x/y/z": "xyz.js"
}
}
}
```
In this example config, I'm attempting to alias the bare module specifier `@x/y/z`.
I **expect** to see 'hidy-ho' logged to the console
I **actually** see this:
```
Import map key "@x/y/z" is invalid because address "xyz.js" is not a valid URL. playground-project.js:139:17
```
Same results for `./xyz.js` as the import target.
Contributor guide
Assessment
This issue has not been assessed yet.