From 82f0936c557a7720e920512d679cdc57d1dde8fe Mon Sep 17 00:00:00 2001 From: qiang Date: Tue, 19 May 2020 11:55:42 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E8=B7=AF=E5=BE=84?= =?UTF-8?q?=E8=BD=AC=E4=B8=BA=20base64=20=E5=90=8E=E5=A4=84=E7=90=86?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E7=9A=84=E9=97=AE=E9=A2=98=20question/96767?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/uni-template-compiler/lib/asset-url.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/uni-template-compiler/lib/asset-url.js b/packages/uni-template-compiler/lib/asset-url.js index 8ffc8986f..2b2849d51 100644 --- a/packages/uni-template-compiler/lib/asset-url.js +++ b/packages/uni-template-compiler/lib/asset-url.js @@ -78,7 +78,7 @@ function rewrite (attr, name, options) { attr.value.startsWith('require("') ) { // require // h5 且 publicPath 为 ./ (仅生产模式可能为./) - attr.value = `(${attr.value}).substr(1)` + attr.value = `(${attr.value}).replace(/^\\./,'')` } } return true @@ -112,4 +112,4 @@ module.exports = { }) } } -} +} -- GitLab