@vnejs/build 0.2.3 → 0.2.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/package.json +1 -1
- package/src/client/vite.config.js +2 -4
- package/src/data/utils.js +8 -12
package/package.json
CHANGED
|
@@ -16,15 +16,13 @@ const {
|
|
|
16
16
|
const buildChunkPattern = /^(index|entry|uis|bundle|web)\.[a-zA-Z0-9_-]+\.js$/;
|
|
17
17
|
const legacyChunkPattern = /^vendors\.[a-zA-Z0-9_.-]+$/;
|
|
18
18
|
|
|
19
|
-
const isClientOutput = (asset) =>
|
|
20
|
-
asset === "index.html" || buildChunkPattern.test(asset) || legacyChunkPattern.test(asset) || asset.startsWith("assets/");
|
|
19
|
+
const isClientOutput = (asset) => asset === "index.html" || buildChunkPattern.test(asset) || legacyChunkPattern.test(asset) || asset.startsWith("assets/");
|
|
21
20
|
|
|
22
21
|
const isBundleModule = (id) => /(@vnejs[/\\]bundles\.|[/\\]bundles[/\\])/.test(id);
|
|
23
22
|
|
|
24
23
|
const isUisModule = (id) => /(@vnejs[/\\]uis\.|[/\\]uis[/\\])/.test(id);
|
|
25
24
|
|
|
26
|
-
const resolveMode = (options) =>
|
|
27
|
-
options.mode ?? (process.env.NODE_ENV === "development" ? "development" : "production");
|
|
25
|
+
const resolveMode = (options) => options.mode ?? (process.env.NODE_ENV === "development" ? "development" : "production");
|
|
28
26
|
|
|
29
27
|
module.exports = (rootPath, options = {}) => {
|
|
30
28
|
const mode = resolveMode(options);
|
package/src/data/utils.js
CHANGED
|
@@ -60,10 +60,13 @@ const parseLines = (lines, label) => {
|
|
|
60
60
|
|
|
61
61
|
curKeys = curKeys.filter(({ indent } = {}) => indent < line.length - line.trim().length);
|
|
62
62
|
|
|
63
|
-
const args = curKeys.reduce(
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
63
|
+
const args = curKeys.reduce(
|
|
64
|
+
(acc, { key }) => {
|
|
65
|
+
if (!acc[key]) acc[key] = {};
|
|
66
|
+
return acc[key];
|
|
67
|
+
},
|
|
68
|
+
realLines[realLines.length - 1].args,
|
|
69
|
+
);
|
|
67
70
|
|
|
68
71
|
args[key] = mapValue(value);
|
|
69
72
|
} else {
|
|
@@ -169,14 +172,7 @@ const mergePlainObjects = (target, source) => {
|
|
|
169
172
|
for (const [key, value] of Object.entries(source)) {
|
|
170
173
|
const current = result[key];
|
|
171
174
|
|
|
172
|
-
if (
|
|
173
|
-
value !== null &&
|
|
174
|
-
typeof value === "object" &&
|
|
175
|
-
!Array.isArray(value) &&
|
|
176
|
-
current !== null &&
|
|
177
|
-
typeof current === "object" &&
|
|
178
|
-
!Array.isArray(current)
|
|
179
|
-
) {
|
|
175
|
+
if (value !== null && typeof value === "object" && !Array.isArray(value) && current !== null && typeof current === "object" && !Array.isArray(current)) {
|
|
180
176
|
result[key] = mergePlainObjects(current, value);
|
|
181
177
|
continue;
|
|
182
178
|
}
|