@jiayouzuo/vite-plugin-css-scope 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -26,14 +26,17 @@ pnpm add @jiayouzuo/vite-plugin-css-scope -D
|
|
|
26
26
|
// vite.config.ts
|
|
27
27
|
import { defineConfig } from 'vite';
|
|
28
28
|
import cssScopePlugin from '@jiayouzuo/vite-plugin-css-scope';
|
|
29
|
+
import react from '@vitejs/plugin-react';
|
|
29
30
|
|
|
30
31
|
export default defineConfig({
|
|
31
32
|
plugins: [
|
|
33
|
+
// ⚠️ 重要:cssScopePlugin 必须放在 react 插件之前
|
|
32
34
|
cssScopePlugin({
|
|
33
35
|
scope: 'appProcess', // 作用域名称
|
|
34
36
|
include: ['src/', 'node_modules/@designable/'], // 要处理的目录
|
|
35
37
|
exclude: ['node_modules/antd'] // 排除的目录(可选)
|
|
36
|
-
})
|
|
38
|
+
}),
|
|
39
|
+
react()
|
|
37
40
|
]
|
|
38
41
|
});
|
|
39
42
|
```
|