From dd8ff912949c97df87832491a302968cd90120a8 Mon Sep 17 00:00:00 2001 From: yutent Date: Fri, 13 Sep 2024 18:36:44 +0800 Subject: [PATCH] =?UTF-8?q?1.4.3:=20=E4=BF=AE=E5=A4=8DLEGACY=5FMODE?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F=E4=B8=8B=E7=9A=84=E8=AF=AD=E6=B3=95=E5=85=BC?= =?UTF-8?q?=E5=AE=B9=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/compile-vue.js | 5 ++++- package.json | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/compile-vue.js b/lib/compile-vue.js index f061f39..999a154 100644 --- a/lib/compile-vue.js +++ b/lib/compile-vue.js @@ -241,6 +241,8 @@ export function parseJs( ` stylesheet.textContent = ${tmp};\n` + ` document.head.appendChild(stylesheet);\n` + `}\n` + + return `let ${tmp};\n!(async function(){\n ${tmp} = await __fite_import('${name}', import.meta.url);\n})()` } else { // CSSStyleSheet.replaceSync 需要FF v101, Safari 16.4才支持 fixedStyle += @@ -251,8 +253,9 @@ export function parseJs( ` __sheets__.push(stylesheet);\n` + ` document.adoptedStyleSheets = __sheets__;\n` + `}\n` + + return `const ${tmp} = await __fite_import('${name}', import.meta.url)` } - return `const ${tmp} = await __fite_import('${name}', import.meta.url)` } else { if (name.startsWith('@/')) { name = name.replace('@/', urlJoin(DEPLOY_PATH, ASSETS_DIR)) diff --git a/package.json b/package.json index 3b606ba..dbe676d 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "fite", "type": "module", - "version": "1.4.2", + "version": "1.4.3", "bin": { "fite": "index.js" },