提交 fd30486d 编写于 作者: DCloud-WZF's avatar DCloud-WZF 💬

fix(uni.scss): 条件编译变量无效 (question/162271)

上级 312fa934
......@@ -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(
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册