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" },