1 | // eslint-disable-next-line import/no-unresolved
|
2 | import { chunkId } from "/.jsenv/BUNDLE_CONSTANTS.js"
|
3 | // eslint-disable-next-line import/no-unresolved
|
4 | import importMap from "/.jsenv/importMap.json"
|
5 | import { resolvePath } from "@jsenv/module-resolution"
|
6 |
|
7 | const { currentScript } = document
|
8 |
|
9 | export const url = (currentScript && currentScript.src) || new URL(chunkId, document.baseURI).href
|
10 |
|
11 | export const resolve = (specifier) => {
|
12 | return resolvePath({ specifier, importer: url, importMap, defaultExtension: false })
|
13 | }
|