From fd30486d72a9f651ce509f07d20b118c319f0a35 Mon Sep 17 00:00:00 2001 From: zhenyuWang <13641039885@163.com> Date: Mon, 6 Feb 2023 17:01:45 +0800 Subject: [PATCH] =?UTF-8?q?fix(uni.scss):=20=E6=9D=A1=E4=BB=B6=E7=BC=96?= =?UTF-8?q?=E8=AF=91=E5=8F=98=E9=87=8F=E6=97=A0=E6=95=88=20(question/16227?= =?UTF-8?q?1)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/vite-plugin-uni/src/config/css.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/vite-plugin-uni/src/config/css.ts b/packages/vite-plugin-uni/src/config/css.ts index e9858c32a9..8b4281fe8b 100644 --- a/packages/vite-plugin-uni/src/config/css.ts +++ b/packages/vite-plugin-uni/src/config/css.ts @@ -2,6 +2,7 @@ import path from 'path' import fs from 'fs-extra' import { UserConfig } from 'vite' import { VitePluginUniResolvedOptions } from '..' +import { preCss } from '@dcloudio/uni-cli-shared' function resolveAdditionalData(inputDir: string, config: UserConfig) { const uniScssFile = path.resolve(inputDir, 'uni.scss') @@ -10,7 +11,9 @@ function resolveAdditionalData(inputDir: string, config: UserConfig) { if (!fs.existsSync(uniScssFile)) { return userAdditionalData } - return fs.readFileSync(uniScssFile, 'utf8') + '\n' + userAdditionalData + return ( + preCss(fs.readFileSync(uniScssFile, 'utf8')) + '\n' + userAdditionalData + ) } export function createCss( -- GitLab