From c69f5fac43cf6d95dbbc38eb47a7144e5896d75d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8A=9B=E7=9A=93?= Date: Thu, 20 Aug 2020 19:38:39 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E5=85=BC=E5=AE=B9=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=20currentScript=20=E7=9A=84=E6=83=85=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/editor-core/package.json | 2 +- packages/editor-core/src/utils/get-public-path.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/editor-core/package.json b/packages/editor-core/package.json index cbf356a2d..448d497f9 100644 --- a/packages/editor-core/package.json +++ b/packages/editor-core/package.json @@ -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", diff --git a/packages/editor-core/src/utils/get-public-path.ts b/packages/editor-core/src/utils/get-public-path.ts index 72627b4f3..1bdb162a4 100644 --- a/packages/editor-core/src/utils/get-public-path.ts +++ b/packages/editor-core/src/utils/get-public-path.ts @@ -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 || ''; }