Skip to content

Commit

Permalink
fix(design-core/preview): 修正cdn解耦preview获取动态的importMap.json的base路径问题
Browse files Browse the repository at this point in the history
  • Loading branch information
rhlin committed Apr 25, 2024
1 parent 6e74402 commit a1d7fb3
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/design-core/src/preview/src/preview/http.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ export const fetchMetaData = async ({ platform, app, type, id, history, tenant }
: {}

export const fetchImportMap = async () => {
return fetch(new URL('./preview-import-map-static/preview-importmap.json', location.href).href).then((res) =>
res.json()
)
const baseUrl = new URL(import.meta.env.BASE_URL, location.href)
return fetch(new URL('./preview-import-map-static/preview-importmap.json', baseUrl).href).then((res) => res.json())
}

0 comments on commit a1d7fb3

Please sign in to comment.