mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-01-13 01:21:58 +00:00
chore: 兼容没有 currentScript 的情况
This commit is contained in:
parent
fa8706600e
commit
c69f5fac43
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@ali/lowcode-editor-core",
|
||||
"version": "0.8.30",
|
||||
"version": "0.8.31",
|
||||
"description": "Core Api for Ali lowCode engine",
|
||||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
const publicPath = (document.currentScript as HTMLScriptElement).src.replace(/^(.*\/)[^/]+$/, '$1');
|
||||
const publicPath = (document.currentScript as HTMLScriptElement)?.src.replace(/^(.*\/)[^/]+$/, '$1');
|
||||
|
||||
export function getPublicPath(): string {
|
||||
return publicPath;
|
||||
return publicPath || '';
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user