Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/nutui-taro-demo/src/app.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@import '../../../src/styles/jd-font.scss';

body {
font-size: 14px;
}
Expand Down
19 changes: 8 additions & 11 deletions scripts/build-taro.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -237,22 +237,19 @@ async function copyStyles() {
resolve(__dirname, '../dist/styles'),
)

const content = [
let content = [
`@import '../theme-default.scss';`,
`@import '../variables.scss';`,
`@import '../mixins/index.scss';`,
`@import '../animation/index.scss';`,
`@import '../theme-dark.scss';`,
`@import '../font-face.scss';`,
]
const projectID = process.env.VITE_APP_PROJECT_ID
if (projectID) {
content[1] = `@import '../variables-${projectID}.scss';`
content = [
`@import '../theme-${projectID}.scss';`,
`@import '../font-face.scss';`,
]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

需要添加缺失的 font-face.scss 文件

检查结果显示:

  • 项目中存在多个主题文件(theme-dark.scss、theme-default.scss、theme-jmapp.scss、theme-jrkf.scss),且内容结构正确
  • 但是缺少构建脚本中引用的 font-face.scss 文件

建议:

  • 在 src/styles 目录下创建 font-face.scss 文件
  • 或者从构建脚本中移除对 font-face.scss 的引用
🔗 Analysis chain

验证项目特定主题文件的存在性

当设置了 VITE_APP_PROJECT_ID 环境变量时,构建脚本会尝试导入项目特定的主题文件。需要确保这些主题文件在指定位置存在。

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# 描述:验证项目特定主题文件是否存在

# 检查主题文件
fd -t f "theme-.*\.scss$" "src/styles"

Length of output: 150


Script:

#!/bin/bash
# 检查主题文件的内容结构,确保它们是有效的 SCSS 文件
for theme in $(fd -t f "theme-.*\.scss$" "src/styles"); do
  echo "=== $theme 内容 ==="
  head -n 5 "$theme"
  echo
done

# 检查 font-face.scss 文件是否存在及其内容
echo "=== font-face.scss 文件检查 ==="
fd -t f "font-face.scss$" "src/styles" -x head -n 5 {}

Length of output: 1380

}
const scssFiles = await glob(['dist/es/packages/**/*.scss'])
scssFiles.forEach((file) => {
content.push(
`@import '${relativeFilePath('/dist/styles/themes/default.scss', '/' + file)}';`,
)
})

dest('dist/styles/themes/default.scss', content.join('\n'))
}

Expand Down
19 changes: 8 additions & 11 deletions scripts/build.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -197,22 +197,19 @@ async function copyStyles() {
resolve(__dirname, '../dist/styles')
)

const content = [
let content = [
`@import '../theme-default.scss';`,
`@import '../variables.scss';`,
`@import '../mixins/index.scss';`,
`@import '../animation/index.scss';`,
`@import '../theme-dark.scss';`,
`@import '../font-face.scss';`,
]
const projectID = process.env.VITE_APP_PROJECT_ID
if (projectID) {
content[1] = `@import '../variables-${projectID}.scss';`
content = [
`@import '../theme-${projectID}.scss';`,
`@import '../font-face.scss';`,
]
}
const scssFiles = await glob(['dist/es/packages/**/*.scss'])
scssFiles.forEach((file) => {
content.push(
`@import '${relativeFilePath('/dist/styles/themes/default.scss', '/' + file)}';`
)
})

dest('dist/styles/themes/default.scss', content.join('\n'))
}

Expand Down
2 changes: 2 additions & 0 deletions src/sites/mobile/App.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@import '../../styles/jd-font.scss';

html,
body {
&::-webkit-scrollbar {
Expand Down
Loading