Skip to content

Commit 653569a

Browse files
committed
docs: update README notes for plugin configuration order
Fixes #18
1 parent 020cde9 commit 653569a

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ English | [简体中文](./README.zh-cn.md)
2020
npm i unplugin-preprocessor-directives
2121
```
2222

23+
> [!NOTE]
24+
> This plugin should be placed **before** all other plugins in your configuration to ensure preprocessor directives are processed first.
25+
2326
<details>
2427
<summary>Vite</summary><br>
2528

@@ -29,7 +32,7 @@ import PreprocessorDirectives from 'unplugin-preprocessor-directives/vite'
2932

3033
export default defineConfig({
3134
plugins: [
32-
PreprocessorDirectives({ /* options */ }),
35+
PreprocessorDirectives({ /* options */ }), // Should be the first plugin
3336
],
3437
})
3538
```

README.zh-cn.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
[English](./README.md) | 简体中文
1212

13-
>[!IMPORTANT]
13+
>[!NOTE]
1414
> 如果你喜欢这个项目,希望你能给这个仓库点一个 star ⭐,你的支持能帮助这个项目加入到 [unplugin 组织](https://github.com/unplugin/.github/issues/5)
1515
1616
## 安装
@@ -19,6 +19,9 @@
1919
npm i unplugin-preprocessor-directives
2020
```
2121

22+
> [!IMPORTANT]
23+
> 此插件应该放在配置中所有其他插件**之前**,以确保预处理器指令首先被处理。
24+
2225
<details>
2326
<summary>Vite</summary><br>
2427

@@ -28,7 +31,7 @@ import PreprocessorDirectives from 'unplugin-preprocessor-directives/vite'
2831

2932
export default defineConfig({
3033
plugins: [
31-
PreprocessorDirectives({ /* options */ }),
34+
PreprocessorDirectives({ /* options */ }), // 应该是第一个插件
3235
],
3336
})
3437
```

0 commit comments

Comments
 (0)