@uni_toolkit/vite-plugin-component-config 0.0.1 → 0.0.3
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 +5 -3
- package/dist/index.cjs +2 -1
- package/dist/index.js +2 -1
- package/package.json +15 -3
package/README.md
CHANGED
|
@@ -54,12 +54,14 @@ export default {
|
|
|
54
54
|
</script>
|
|
55
55
|
|
|
56
56
|
<component-config>
|
|
57
|
+
// 此处必须是标准的 json 对象
|
|
57
58
|
{
|
|
58
59
|
"usingComponents": {
|
|
59
60
|
"custom-button": "/components/custom-button"
|
|
60
61
|
},
|
|
61
|
-
"
|
|
62
|
-
|
|
62
|
+
"componentPlaceholder": {
|
|
63
|
+
"test": "view",
|
|
64
|
+
}
|
|
63
65
|
}
|
|
64
66
|
</component-config>
|
|
65
67
|
```
|
|
@@ -80,4 +82,4 @@ interface ComponentConfigPluginOptions {
|
|
|
80
82
|
|
|
81
83
|
## 许可证
|
|
82
84
|
|
|
83
|
-
MIT
|
|
85
|
+
[MIT](/LICENSE)
|
package/dist/index.cjs
CHANGED
|
@@ -38,6 +38,7 @@ var import_pluginutils = require("@rollup/pluginutils");
|
|
|
38
38
|
var import_path = __toESM(require("path"), 1);
|
|
39
39
|
var import_fs = __toESM(require("fs"), 1);
|
|
40
40
|
var import_uni_cli_shared = require("@dcloudio/uni-cli-shared");
|
|
41
|
+
var import_lodash_es = require("lodash-es");
|
|
41
42
|
function vitePluginComponentConfig(options = {
|
|
42
43
|
include: ["**/*.{vue,nvue,uvue}"],
|
|
43
44
|
exclude: []
|
|
@@ -88,7 +89,7 @@ function vitePluginComponentConfig(options = {
|
|
|
88
89
|
const json = JSON.parse(content);
|
|
89
90
|
import_fs.default.writeFileSync(
|
|
90
91
|
outputPath,
|
|
91
|
-
JSON.stringify(
|
|
92
|
+
JSON.stringify((0, import_lodash_es.merge)(json, config), null, 2)
|
|
92
93
|
);
|
|
93
94
|
}
|
|
94
95
|
}
|
package/dist/index.js
CHANGED
|
@@ -4,6 +4,7 @@ import { createFilter } from "@rollup/pluginutils";
|
|
|
4
4
|
import path from "path";
|
|
5
5
|
import fs from "fs";
|
|
6
6
|
import { parseJson } from "@dcloudio/uni-cli-shared";
|
|
7
|
+
import { merge } from "lodash-es";
|
|
7
8
|
function vitePluginComponentConfig(options = {
|
|
8
9
|
include: ["**/*.{vue,nvue,uvue}"],
|
|
9
10
|
exclude: []
|
|
@@ -54,7 +55,7 @@ function vitePluginComponentConfig(options = {
|
|
|
54
55
|
const json = JSON.parse(content);
|
|
55
56
|
fs.writeFileSync(
|
|
56
57
|
outputPath,
|
|
57
|
-
JSON.stringify(
|
|
58
|
+
JSON.stringify(merge(json, config), null, 2)
|
|
58
59
|
);
|
|
59
60
|
}
|
|
60
61
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uni_toolkit/vite-plugin-component-config",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "chouchouji <1305974212@qq.com>",
|
|
6
6
|
"type": "module",
|
|
@@ -14,6 +14,13 @@
|
|
|
14
14
|
"publishConfig": {
|
|
15
15
|
"access": "public"
|
|
16
16
|
},
|
|
17
|
+
"homepage": "https://github.com/uni-toolkit/uni-toolkit/tree/main/packages/vite-plugin-component-config",
|
|
18
|
+
"bugs": "https://github.com/uni-toolkit/uni-toolkit/issues",
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "https://github.com/uni-toolkit/uni-toolkit.git",
|
|
22
|
+
"directory": "packages/vite-plugin-component-config"
|
|
23
|
+
},
|
|
17
24
|
"main": "dist/index.cjs",
|
|
18
25
|
"module": "dist/index.js",
|
|
19
26
|
"types": "dist/index.d.ts",
|
|
@@ -24,12 +31,17 @@
|
|
|
24
31
|
"@dcloudio/uni-cli-shared": "3.0.0-alpha-4080120250820001",
|
|
25
32
|
"vite": "^7.1.7",
|
|
26
33
|
"@rollup/pluginutils": "^5.3.0",
|
|
27
|
-
"
|
|
34
|
+
"lodash-es": "^4.17.21",
|
|
35
|
+
"@uni_toolkit/shared": "0.0.3"
|
|
28
36
|
},
|
|
29
37
|
"devDependencies": {
|
|
30
38
|
"typescript": "5.3.3",
|
|
31
39
|
"tsup": "7.2.0",
|
|
32
|
-
"@types/node": "^18.7.20"
|
|
40
|
+
"@types/node": "^18.7.20",
|
|
41
|
+
"@types/lodash-es": "^4.17.12"
|
|
42
|
+
},
|
|
43
|
+
"peerDependencies": {
|
|
44
|
+
"vite": "^5.0.0"
|
|
33
45
|
},
|
|
34
46
|
"scripts": {
|
|
35
47
|
"build": "tsup src/index.ts --format esm,cjs --out-dir=dist --dts --clean",
|