diff --git a/uni.scss b/uni.scss index 0b7039d..4e0ede8 100644 --- a/uni.scss +++ b/uni.scss @@ -13,7 +13,7 @@ */ /* 颜色变量 */ -@import 'uview-plus/theme.scss'; +@import '~uview-plus/theme.scss'; /* 行为相关颜色 */ $uni-color-primary: #007aff; $uni-color-success: #4cd964; diff --git a/vite.config.js b/vite.config.js index c0b38e0..91ffecd 100644 --- a/vite.config.js +++ b/vite.config.js @@ -3,4 +3,14 @@ import uni from '@dcloudio/vite-plugin-uni' export default defineConfig({ plugins: [uni()], + css: { + preprocessorOptions: { + scss: { + // 使用传统编译器以保证兼容性 + api: 'legacy', + // 添加 node_modules 到导入路径 + silenceDeprecations: ['legacy-js-api'] + } + } + } })