From 59417493c84474d41c1dd2e0d54f46304d5676a5 Mon Sep 17 00:00:00 2001 From: winixt Date: Fri, 2 Jun 2023 10:46:33 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/plugins/features/globalCSS.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/packages/fes-preset-built-in/src/plugins/features/globalCSS.js b/packages/fes-preset-built-in/src/plugins/features/globalCSS.js index 85012bb5..2368ee78 100644 --- a/packages/fes-preset-built-in/src/plugins/features/globalCSS.js +++ b/packages/fes-preset-built-in/src/plugins/features/globalCSS.js @@ -31,12 +31,11 @@ export default (api) => { return []; }, }); + api.addEntryCodeAhead(() => { + if (!isBeforeImports()) { + return `import '${utils.winPath(relative(absTmpPath, globalCSSFile[0]))}';`; + } + return []; + }); } - - api.addEntryCodeAhead(() => { - if (!isBeforeImports()) { - return `${globalCSSFile.map((file) => `import '${utils.winPath(relative(absTmpPath, file))}';`).join('')}`; - } - return []; - }); };