Skip to content

Commit 67cb485

Browse files
committed
fix: sass warn
1 parent 459d3cc commit 67cb485

File tree

7 files changed

+249
-60
lines changed

7 files changed

+249
-60
lines changed

packages/theme/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
### Patch Changes
66

77
- chore: update dependencies
8-
- fix: sass warn
8+
- fix: sass warn - [legacy-js-api](https://sass-lang.com/documentation/breaking-changes/legacy-js-api/)
99

1010
## 0.5.1
1111

packages/theme/docs/changelog.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ bun install vitepress@latest
3232
### Patch Changes
3333

3434
- chore: update dependencies
35-
- fix: sass warn
35+
- fix: sass warn - [legacy-js-api](https://sass-lang.com/documentation/breaking-changes/legacy-js-api/)
3636

3737
## 0.5.1 (2024/10/21)
3838

packages/theme/docs/example/BlogExample.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ function handleUpdatePageNum(current: number) {
6868
</template>
6969

7070
<style lang="scss" scoped>
71-
@import './style.scss';
71+
@use './style.scss';
7272
7373
.el-pagination-wrapper {
7474
:deep(.el-pagination li.is-active.number) {

packages/theme/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
"artalk": "^2.8.5",
7373
"element-plus": "^2.7.2",
7474
"pagefind": "^1.2.0",
75-
"sass": "^1.77.8",
75+
"sass": "^1.80.6",
7676
"typescript": "^5.4.5",
7777
"vite": "^5.4.9",
7878
"vitepress": "1.5.0",

packages/theme/src/node.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,16 @@ export function getThemeConfig(cfg: Partial<Theme.BlogConfig> = {}) {
2323
// 文章数据
2424
const pagesData: Theme.PageData[] = []
2525
const extraVPConfig: any = {
26-
vite: {}
26+
vite: {
27+
// see https://sass-lang.com/documentation/breaking-changes/legacy-js-api/
28+
css: {
29+
preprocessorOptions: {
30+
scss: {
31+
api: 'modern',
32+
},
33+
},
34+
},
35+
},
2736
}
2837

2938
// 获取要加载的vite插件

packages/theme/src/utils/node/vitePlugins.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ export function getVitePlugins(cfg: Partial<Theme.BlogConfig> = {}) {
6464

6565
export function registerVitePlugins(vpCfg: any, plugins: any[]) {
6666
vpCfg.vite = {
67-
plugins
67+
plugins,
68+
...vpCfg.vite,
6869
}
6970
}
7071

0 commit comments

Comments
 (0)