@mc-markets/ui 1.1.1 → 1.1.2

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/RESOLVER_USAGE.md CHANGED
@@ -17,6 +17,8 @@ npm install -D unplugin-vue-components
17
17
 
18
18
  ### Vite 配置
19
19
 
20
+ #### ES 模块方式(推荐)
21
+
20
22
  在你的 `vite.config.js` 或 `vite.config.ts` 中:
21
23
 
22
24
  ```js
@@ -41,6 +43,33 @@ export default defineConfig({
41
43
  })
42
44
  ```
43
45
 
46
+ #### CommonJS 方式
47
+
48
+ 如果你的配置文件使用 CommonJS 格式:
49
+
50
+ ```js
51
+ const { defineConfig } = require('vite')
52
+ const vue = require('@vitejs/plugin-vue')
53
+ const Components = require('unplugin-vue-components/vite')
54
+ const { McMarketsUiResolver } = require('@mc-markets/ui/resolver')
55
+
56
+ module.exports = defineConfig({
57
+ plugins: [
58
+ vue(),
59
+ Components({
60
+ resolvers: [
61
+ McMarketsUiResolver({
62
+ importStyle: true,
63
+ styleType: 'css'
64
+ })
65
+ ]
66
+ })
67
+ ]
68
+ })
69
+ ```
70
+
71
+ > **💡 提示**: Resolver 自动支持 ES 模块和 CommonJS 两种格式,无需额外配置。
72
+
44
73
  ### Webpack 配置
45
74
 
46
75
  在你的 `webpack.config.js` 中: