weapp-vite 5.11.0 → 5.11.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/dist/auto-routes.cjs +2 -2
- package/dist/auto-routes.mjs +1 -1
- package/dist/{chunk-NPMFLWIR.mjs → chunk-2G3CI4U3.mjs} +1 -1
- package/dist/{chunk-5OVHBJIB.cjs → chunk-53HNLH2N.cjs} +4 -4
- package/dist/{chunk-7JZ3SMTK.mjs → chunk-OUPZ22AZ.mjs} +45 -3
- package/dist/{chunk-F3RCFW4U.cjs → chunk-PYBV5NXO.cjs} +115 -73
- package/dist/cli.cjs +55 -55
- package/dist/cli.mjs +2 -2
- package/dist/index.cjs +3 -3
- package/dist/index.mjs +2 -2
- package/package.json +8 -8
package/dist/auto-routes.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkPYBV5NXOcjs = require('./chunk-PYBV5NXO.cjs');
|
|
4
4
|
require('./chunk-4DCIL32Z.cjs');
|
|
5
5
|
require('./chunk-GUSULIGY.cjs');
|
|
6
6
|
|
|
@@ -24,7 +24,7 @@ function createGetter(resolver) {
|
|
|
24
24
|
get: resolver
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
|
-
var ctx =
|
|
27
|
+
var ctx = _chunkPYBV5NXOcjs.getCompilerContext.call(void 0, );
|
|
28
28
|
var service = ctx.autoRoutesService;
|
|
29
29
|
var routes = {};
|
|
30
30
|
Object.defineProperties(routes, {
|
package/dist/auto-routes.mjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunkPYBV5NXOcjs = require('./chunk-PYBV5NXO.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
var _chunkL34YWFZMcjs = require('./chunk-L34YWFZM.cjs');
|
|
@@ -12,10 +12,10 @@ _chunkL34YWFZMcjs.init_cjs_shims.call(void 0, );
|
|
|
12
12
|
async function createCompilerContext(options) {
|
|
13
13
|
const key = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _ => _.key]), () => ( "default"));
|
|
14
14
|
if (!_optionalChain([options, 'optionalAccess', _2 => _2.key])) {
|
|
15
|
-
|
|
15
|
+
_chunkPYBV5NXOcjs.resetCompilerContext.call(void 0, key);
|
|
16
16
|
}
|
|
17
|
-
|
|
18
|
-
const ctx =
|
|
17
|
+
_chunkPYBV5NXOcjs.setActiveCompilerContextKey.call(void 0, key);
|
|
18
|
+
const ctx = _chunkPYBV5NXOcjs.getCompilerContext.call(void 0, key);
|
|
19
19
|
const { configService, scanService, autoRoutesService } = ctx;
|
|
20
20
|
await configService.load(options);
|
|
21
21
|
if (autoRoutesService) {
|
|
@@ -24703,6 +24703,47 @@ function createCoreLifecyclePlugin(state) {
|
|
|
24703
24703
|
const duplicateWarningBytes = Number(configService.weappViteConfig?.chunks?.duplicateWarningBytes ?? 0);
|
|
24704
24704
|
const shouldWarnOnDuplicate = Number.isFinite(duplicateWarningBytes) && duplicateWarningBytes > 0;
|
|
24705
24705
|
let redundantBytesTotal = 0;
|
|
24706
|
+
const resolveSharedChunkLabel = (sharedFileName, finalFileName) => {
|
|
24707
|
+
const prettifyModuleLabel = (label) => {
|
|
24708
|
+
const normalized = label.replace(/\\/g, "/");
|
|
24709
|
+
const match2 = normalized.match(/node_modules\/(?:\.pnpm\/[^/]+\/node_modules\/)?(.+)/);
|
|
24710
|
+
return match2?.[1] || label;
|
|
24711
|
+
};
|
|
24712
|
+
const candidates = [];
|
|
24713
|
+
const collect = (output) => {
|
|
24714
|
+
if (output?.type === "chunk") {
|
|
24715
|
+
candidates.push(output);
|
|
24716
|
+
}
|
|
24717
|
+
};
|
|
24718
|
+
collect(bundle[sharedFileName]);
|
|
24719
|
+
if (finalFileName !== sharedFileName) {
|
|
24720
|
+
collect(bundle[finalFileName]);
|
|
24721
|
+
}
|
|
24722
|
+
if (!candidates.length) {
|
|
24723
|
+
const matched = Object.values(bundle).find(
|
|
24724
|
+
(output) => output?.type === "chunk" && ((output.fileName ?? "") === finalFileName || (output.fileName ?? "") === sharedFileName)
|
|
24725
|
+
);
|
|
24726
|
+
if (matched) {
|
|
24727
|
+
candidates.push(matched);
|
|
24728
|
+
}
|
|
24729
|
+
}
|
|
24730
|
+
const chunk = candidates[0];
|
|
24731
|
+
if (!chunk) {
|
|
24732
|
+
return finalFileName;
|
|
24733
|
+
}
|
|
24734
|
+
const moduleLabels = Array.from(
|
|
24735
|
+
new Set(
|
|
24736
|
+
Object.keys(chunk.modules ?? {}).filter((id) => id && !id.startsWith("\0")).map((id) => configService.relativeAbsoluteSrcRoot(id)).filter(Boolean)
|
|
24737
|
+
)
|
|
24738
|
+
);
|
|
24739
|
+
if (!moduleLabels.length) {
|
|
24740
|
+
return chunk.fileName || finalFileName;
|
|
24741
|
+
}
|
|
24742
|
+
const preview = moduleLabels.map(prettifyModuleLabel).slice(0, 3);
|
|
24743
|
+
const remaining = moduleLabels.length - preview.length;
|
|
24744
|
+
const suffix = remaining > 0 ? ` \u7B49 ${moduleLabels.length} \u4E2A\u6A21\u5757` : "";
|
|
24745
|
+
return `${preview.join("\u3001")}${suffix}`;
|
|
24746
|
+
};
|
|
24706
24747
|
const handleDuplicate = shouldLogChunks || shouldWarnOnDuplicate ? ({ duplicates, ignoredMainImporters, chunkBytes, redundantBytes, retainedInMain, sharedFileName }) => {
|
|
24707
24748
|
if (shouldWarnOnDuplicate) {
|
|
24708
24749
|
const duplicateCount = duplicates.length;
|
|
@@ -24731,7 +24772,7 @@ function createCoreLifecyclePlugin(state) {
|
|
|
24731
24772
|
strategy: sharedStrategy,
|
|
24732
24773
|
subPackageRoots,
|
|
24733
24774
|
onDuplicate: handleDuplicate,
|
|
24734
|
-
onFallback: shouldLogChunks ? ({ reason, importers }) => {
|
|
24775
|
+
onFallback: shouldLogChunks ? ({ reason, importers, sharedFileName, finalFileName }) => {
|
|
24735
24776
|
const involvedSubs = /* @__PURE__ */ new Set();
|
|
24736
24777
|
let hasMainReference = false;
|
|
24737
24778
|
for (const importer of importers) {
|
|
@@ -24750,10 +24791,11 @@ function createCoreLifecyclePlugin(state) {
|
|
|
24750
24791
|
segments.push("\u4E3B\u5305");
|
|
24751
24792
|
}
|
|
24752
24793
|
const scope = segments.join("\u3001") || "\u4E3B\u5305";
|
|
24794
|
+
const sharedChunkLabel = resolveSharedChunkLabel(sharedFileName, finalFileName);
|
|
24753
24795
|
if (reason === "main-package") {
|
|
24754
|
-
logger_default.info(`[subpackages] ${scope} \u5171\u4EAB\u6A21\u5757\uFF08${importers.length} \u5904\u5F15\u7528\uFF09\u5DF2\u63D0\u5347\u5230\u4E3B\u5305 common.js`);
|
|
24796
|
+
logger_default.info(`[subpackages] ${scope} \u5171\u4EAB\u6A21\u5757 ${sharedChunkLabel}\uFF08${importers.length} \u5904\u5F15\u7528\uFF09\u5DF2\u63D0\u5347\u5230\u4E3B\u5305 common.js`);
|
|
24755
24797
|
} else {
|
|
24756
|
-
logger_default.info(`[subpackages] \u4EC5\u4E3B\u5305\u4F7F\u7528\u5171\u4EAB\u6A21\u5757\uFF08${importers.length} \u5904\u5F15\u7528\uFF09\uFF0C\u4FDD\u7559\u5728\u4E3B\u5305 common.js`);
|
|
24798
|
+
logger_default.info(`[subpackages] \u4EC5\u4E3B\u5305\u4F7F\u7528\u5171\u4EAB\u6A21\u5757 ${sharedChunkLabel}\uFF08${importers.length} \u5904\u5F15\u7528\uFF09\uFF0C\u4FDD\u7559\u5728\u4E3B\u5305 common.js`);
|
|
24757
24799
|
}
|
|
24758
24800
|
} : void 0
|
|
24759
24801
|
});
|
|
@@ -24704,6 +24704,47 @@ function createCoreLifecyclePlugin(state) {
|
|
|
24704
24704
|
const duplicateWarningBytes = Number(_nullishCoalesce(_optionalChain([configService, 'access', _422 => _422.weappViteConfig, 'optionalAccess', _423 => _423.chunks, 'optionalAccess', _424 => _424.duplicateWarningBytes]), () => ( 0)));
|
|
24705
24705
|
const shouldWarnOnDuplicate = Number.isFinite(duplicateWarningBytes) && duplicateWarningBytes > 0;
|
|
24706
24706
|
let redundantBytesTotal = 0;
|
|
24707
|
+
const resolveSharedChunkLabel = (sharedFileName, finalFileName) => {
|
|
24708
|
+
const prettifyModuleLabel = (label) => {
|
|
24709
|
+
const normalized = label.replace(/\\/g, "/");
|
|
24710
|
+
const match2 = normalized.match(/node_modules\/(?:\.pnpm\/[^/]+\/node_modules\/)?(.+)/);
|
|
24711
|
+
return _optionalChain([match2, 'optionalAccess', _425 => _425[1]]) || label;
|
|
24712
|
+
};
|
|
24713
|
+
const candidates = [];
|
|
24714
|
+
const collect = (output) => {
|
|
24715
|
+
if (_optionalChain([output, 'optionalAccess', _426 => _426.type]) === "chunk") {
|
|
24716
|
+
candidates.push(output);
|
|
24717
|
+
}
|
|
24718
|
+
};
|
|
24719
|
+
collect(bundle[sharedFileName]);
|
|
24720
|
+
if (finalFileName !== sharedFileName) {
|
|
24721
|
+
collect(bundle[finalFileName]);
|
|
24722
|
+
}
|
|
24723
|
+
if (!candidates.length) {
|
|
24724
|
+
const matched = Object.values(bundle).find(
|
|
24725
|
+
(output) => _optionalChain([output, 'optionalAccess', _427 => _427.type]) === "chunk" && ((_nullishCoalesce(output.fileName, () => ( ""))) === finalFileName || (_nullishCoalesce(output.fileName, () => ( ""))) === sharedFileName)
|
|
24726
|
+
);
|
|
24727
|
+
if (matched) {
|
|
24728
|
+
candidates.push(matched);
|
|
24729
|
+
}
|
|
24730
|
+
}
|
|
24731
|
+
const chunk = candidates[0];
|
|
24732
|
+
if (!chunk) {
|
|
24733
|
+
return finalFileName;
|
|
24734
|
+
}
|
|
24735
|
+
const moduleLabels = Array.from(
|
|
24736
|
+
new Set(
|
|
24737
|
+
Object.keys(_nullishCoalesce(chunk.modules, () => ( {}))).filter((id) => id && !id.startsWith("\0")).map((id) => configService.relativeAbsoluteSrcRoot(id)).filter(Boolean)
|
|
24738
|
+
)
|
|
24739
|
+
);
|
|
24740
|
+
if (!moduleLabels.length) {
|
|
24741
|
+
return chunk.fileName || finalFileName;
|
|
24742
|
+
}
|
|
24743
|
+
const preview = moduleLabels.map(prettifyModuleLabel).slice(0, 3);
|
|
24744
|
+
const remaining = moduleLabels.length - preview.length;
|
|
24745
|
+
const suffix = remaining > 0 ? ` \u7B49 ${moduleLabels.length} \u4E2A\u6A21\u5757` : "";
|
|
24746
|
+
return `${preview.join("\u3001")}${suffix}`;
|
|
24747
|
+
};
|
|
24707
24748
|
const handleDuplicate = shouldLogChunks || shouldWarnOnDuplicate ? ({ duplicates, ignoredMainImporters, chunkBytes, redundantBytes, retainedInMain, sharedFileName }) => {
|
|
24708
24749
|
if (shouldWarnOnDuplicate) {
|
|
24709
24750
|
const duplicateCount = duplicates.length;
|
|
@@ -24721,7 +24762,7 @@ function createCoreLifecyclePlugin(state) {
|
|
|
24721
24762
|
}
|
|
24722
24763
|
}
|
|
24723
24764
|
const subPackageList = Array.from(subPackageSet).join("\u3001") || "\u76F8\u5173\u5206\u5305";
|
|
24724
|
-
const ignoredHint = _optionalChain([ignoredMainImporters, 'optionalAccess',
|
|
24765
|
+
const ignoredHint = _optionalChain([ignoredMainImporters, 'optionalAccess', _428 => _428.length]) ? `\uFF0C\u5FFD\u7565\u4E3B\u5305\u5F15\u7528\uFF1A${ignoredMainImporters.join("\u3001")}` : "";
|
|
24725
24766
|
logger_default.info(`[subpackages] \u5206\u5305 ${subPackageList} \u5171\u4EAB\u6A21\u5757\u5DF2\u590D\u5236\u5230\u5404\u81EA weapp-shared/common.js\uFF08${totalReferences} \u5904\u5F15\u7528${ignoredHint}\uFF09`);
|
|
24726
24767
|
if (retainedInMain) {
|
|
24727
24768
|
logger_default.warn(`[subpackages] \u6A21\u5757 ${sharedFileName} \u540C\u65F6\u88AB\u4E3B\u5305\u5F15\u7528\uFF0C\u56E0\u6B64\u4ECD\u4FDD\u7559\u5728\u4E3B\u5305 common.js\uFF0C\u5E76\u590D\u5236\u5230 ${subPackageList}\uFF0C\u8BF7\u786E\u8BA4\u662F\u5426\u9700\u8981\u5C06\u6E90\u4EE3\u7801\u79FB\u52A8\u5230\u4E3B\u5305\u6216\u516C\u5171\u76EE\u5F55\u3002`);
|
|
@@ -24732,7 +24773,7 @@ function createCoreLifecyclePlugin(state) {
|
|
|
24732
24773
|
strategy: sharedStrategy,
|
|
24733
24774
|
subPackageRoots,
|
|
24734
24775
|
onDuplicate: handleDuplicate,
|
|
24735
|
-
onFallback: shouldLogChunks ? ({ reason, importers }) => {
|
|
24776
|
+
onFallback: shouldLogChunks ? ({ reason, importers, sharedFileName, finalFileName }) => {
|
|
24736
24777
|
const involvedSubs = /* @__PURE__ */ new Set();
|
|
24737
24778
|
let hasMainReference = false;
|
|
24738
24779
|
for (const importer of importers) {
|
|
@@ -24751,10 +24792,11 @@ function createCoreLifecyclePlugin(state) {
|
|
|
24751
24792
|
segments.push("\u4E3B\u5305");
|
|
24752
24793
|
}
|
|
24753
24794
|
const scope = segments.join("\u3001") || "\u4E3B\u5305";
|
|
24795
|
+
const sharedChunkLabel = resolveSharedChunkLabel(sharedFileName, finalFileName);
|
|
24754
24796
|
if (reason === "main-package") {
|
|
24755
|
-
logger_default.info(`[subpackages] ${scope} \u5171\u4EAB\u6A21\u5757\uFF08${importers.length} \u5904\u5F15\u7528\uFF09\u5DF2\u63D0\u5347\u5230\u4E3B\u5305 common.js`);
|
|
24797
|
+
logger_default.info(`[subpackages] ${scope} \u5171\u4EAB\u6A21\u5757 ${sharedChunkLabel}\uFF08${importers.length} \u5904\u5F15\u7528\uFF09\u5DF2\u63D0\u5347\u5230\u4E3B\u5305 common.js`);
|
|
24756
24798
|
} else {
|
|
24757
|
-
logger_default.info(`[subpackages] \u4EC5\u4E3B\u5305\u4F7F\u7528\u5171\u4EAB\u6A21\u5757\uFF08${importers.length} \u5904\u5F15\u7528\uFF09\uFF0C\u4FDD\u7559\u5728\u4E3B\u5305 common.js`);
|
|
24799
|
+
logger_default.info(`[subpackages] \u4EC5\u4E3B\u5305\u4F7F\u7528\u5171\u4EAB\u6A21\u5757 ${sharedChunkLabel}\uFF08${importers.length} \u5904\u5F15\u7528\uFF09\uFF0C\u4FDD\u7559\u5728\u4E3B\u5305 common.js`);
|
|
24758
24800
|
}
|
|
24759
24801
|
} : void 0
|
|
24760
24802
|
});
|
|
@@ -24766,10 +24808,10 @@ function createCoreLifecyclePlugin(state) {
|
|
|
24766
24808
|
configService,
|
|
24767
24809
|
entriesMap: state.entriesMap
|
|
24768
24810
|
});
|
|
24769
|
-
if (_optionalChain([configService, 'access',
|
|
24811
|
+
if (_optionalChain([configService, 'access', _429 => _429.weappViteConfig, 'optionalAccess', _430 => _430.debug, 'optionalAccess', _431 => _431.watchFiles])) {
|
|
24770
24812
|
const watcherService = ctx.watcherService;
|
|
24771
|
-
const watcherRoot = _nullishCoalesce(_optionalChain([subPackageMeta, 'optionalAccess',
|
|
24772
|
-
const watcher = _optionalChain([watcherService, 'optionalAccess',
|
|
24813
|
+
const watcherRoot = _nullishCoalesce(_optionalChain([subPackageMeta, 'optionalAccess', _432 => _432.subPackage, 'access', _433 => _433.root]), () => ( "/"));
|
|
24814
|
+
const watcher = _optionalChain([watcherService, 'optionalAccess', _434 => _434.getRollupWatcher, 'call', _435 => _435(watcherRoot)]);
|
|
24773
24815
|
let watchFiles;
|
|
24774
24816
|
if (watcher && typeof watcher.getWatchFiles === "function") {
|
|
24775
24817
|
watchFiles = await watcher.getWatchFiles();
|
|
@@ -24783,7 +24825,7 @@ function createCoreLifecyclePlugin(state) {
|
|
|
24783
24825
|
}
|
|
24784
24826
|
},
|
|
24785
24827
|
buildEnd() {
|
|
24786
|
-
_optionalChain([debug2, 'optionalCall',
|
|
24828
|
+
_optionalChain([debug2, 'optionalCall', _436 => _436(`${subPackageMeta ? `\u72EC\u7ACB\u5206\u5305 ${subPackageMeta.subPackage.root}` : "\u4E3B\u5305"} ${Array.from(this.getModuleIds()).length} \u4E2A\u6A21\u5757\u88AB\u7F16\u8BD1`)]);
|
|
24787
24829
|
}
|
|
24788
24830
|
};
|
|
24789
24831
|
}
|
|
@@ -24986,7 +25028,7 @@ async function flushIndependentBuilds(state) {
|
|
|
24986
25028
|
}
|
|
24987
25029
|
const outputs = await Promise.all(pendingIndependentBuilds);
|
|
24988
25030
|
for (const { rollup } of outputs) {
|
|
24989
|
-
const bundleOutputs = Array.isArray(_optionalChain([rollup, 'optionalAccess',
|
|
25031
|
+
const bundleOutputs = Array.isArray(_optionalChain([rollup, 'optionalAccess', _437 => _437.output])) ? rollup.output : [];
|
|
24990
25032
|
for (const output of bundleOutputs) {
|
|
24991
25033
|
if (output.type === "chunk") {
|
|
24992
25034
|
this.emitFile({
|
|
@@ -25023,13 +25065,13 @@ function toPosixPath(value) {
|
|
|
25023
25065
|
var styleMatcherCache = /* @__PURE__ */ new WeakMap();
|
|
25024
25066
|
function collectSharedStyleEntries(ctx, configService) {
|
|
25025
25067
|
const map = /* @__PURE__ */ new Map();
|
|
25026
|
-
const registry = _optionalChain([ctx, 'access',
|
|
25027
|
-
if (!_optionalChain([registry, 'optionalAccess',
|
|
25068
|
+
const registry = _optionalChain([ctx, 'access', _438 => _438.scanService, 'optionalAccess', _439 => _439.subPackageMap]);
|
|
25069
|
+
if (!_optionalChain([registry, 'optionalAccess', _440 => _440.size])) {
|
|
25028
25070
|
return map;
|
|
25029
25071
|
}
|
|
25030
25072
|
const currentRoot = configService.currentSubPackageRoot;
|
|
25031
25073
|
for (const [root, meta] of registry.entries()) {
|
|
25032
|
-
if (!_optionalChain([meta, 'access',
|
|
25074
|
+
if (!_optionalChain([meta, 'access', _441 => _441.styleEntries, 'optionalAccess', _442 => _442.length])) {
|
|
25033
25075
|
continue;
|
|
25034
25076
|
}
|
|
25035
25077
|
if (currentRoot && root !== currentRoot) {
|
|
@@ -25074,12 +25116,12 @@ function getStyleMatcher(entry) {
|
|
|
25074
25116
|
if (cached) {
|
|
25075
25117
|
return cached;
|
|
25076
25118
|
}
|
|
25077
|
-
const includePatterns = _optionalChain([entry, 'access',
|
|
25078
|
-
const excludePatterns = _optionalChain([entry, 'access',
|
|
25119
|
+
const includePatterns = _optionalChain([entry, 'access', _443 => _443.include, 'optionalAccess', _444 => _444.length]) ? entry.include : ["**/*"];
|
|
25120
|
+
const excludePatterns = _optionalChain([entry, 'access', _445 => _445.exclude, 'optionalAccess', _446 => _446.length]) ? entry.exclude : void 0;
|
|
25079
25121
|
const matcher = {
|
|
25080
25122
|
include: _picomatch2.default.call(void 0, includePatterns, { dot: true })
|
|
25081
25123
|
};
|
|
25082
|
-
if (_optionalChain([excludePatterns, 'optionalAccess',
|
|
25124
|
+
if (_optionalChain([excludePatterns, 'optionalAccess', _447 => _447.length])) {
|
|
25083
25125
|
matcher.exclude = _picomatch2.default.call(void 0, excludePatterns, { dot: true });
|
|
25084
25126
|
}
|
|
25085
25127
|
styleMatcherCache.set(entry, matcher);
|
|
@@ -25184,7 +25226,7 @@ function injectSharedStyleImports(css2, modulePath, fileName, sharedStyles, conf
|
|
|
25184
25226
|
}
|
|
25185
25227
|
const normalizedFileName = toPosixPath(fileName);
|
|
25186
25228
|
const entries = findSharedStylesForModule(normalizedModule, normalizedFileName, sharedStyles);
|
|
25187
|
-
if (!_optionalChain([entries, 'optionalAccess',
|
|
25229
|
+
if (!_optionalChain([entries, 'optionalAccess', _448 => _448.length])) {
|
|
25188
25230
|
return css2;
|
|
25189
25231
|
}
|
|
25190
25232
|
const specifiers = resolveImportSpecifiers(fileName, entries);
|
|
@@ -25396,14 +25438,14 @@ function createPluginPruner() {
|
|
|
25396
25438
|
name: "weapp-vite:preflight",
|
|
25397
25439
|
enforce: "pre",
|
|
25398
25440
|
configResolved(config) {
|
|
25399
|
-
if (!_optionalChain([config, 'access',
|
|
25441
|
+
if (!_optionalChain([config, 'access', _449 => _449.plugins, 'optionalAccess', _450 => _450.length])) {
|
|
25400
25442
|
return;
|
|
25401
25443
|
}
|
|
25402
25444
|
for (const removePlugin of removePlugins) {
|
|
25403
25445
|
const idx = config.plugins.findIndex((plugin) => plugin.name === removePlugin);
|
|
25404
25446
|
if (idx > -1) {
|
|
25405
25447
|
const [plugin] = config.plugins.splice(idx, 1);
|
|
25406
|
-
plugin && _optionalChain([debug3, 'optionalCall',
|
|
25448
|
+
plugin && _optionalChain([debug3, 'optionalCall', _451 => _451("remove plugin", plugin.name)]);
|
|
25407
25449
|
}
|
|
25408
25450
|
}
|
|
25409
25451
|
}
|
|
@@ -25459,8 +25501,8 @@ function createWorkerBuildPlugin(ctx) {
|
|
|
25459
25501
|
name: "weapp-vite:workers",
|
|
25460
25502
|
enforce: "pre",
|
|
25461
25503
|
async options(options) {
|
|
25462
|
-
const workerConfig = _optionalChain([configService, 'access',
|
|
25463
|
-
const entries = Array.isArray(_optionalChain([workerConfig, 'optionalAccess',
|
|
25504
|
+
const workerConfig = _optionalChain([configService, 'access', _452 => _452.weappViteConfig, 'optionalAccess', _453 => _453.worker]);
|
|
25505
|
+
const entries = Array.isArray(_optionalChain([workerConfig, 'optionalAccess', _454 => _454.entry])) ? workerConfig.entry : [_optionalChain([workerConfig, 'optionalAccess', _455 => _455.entry])];
|
|
25464
25506
|
const normalized = (await Promise.all(entries.filter(Boolean).map((entry) => resolveWorkerEntry(ctx, entry)))).filter((result) => Boolean(result.value)).reduce((acc, cur) => {
|
|
25465
25507
|
acc[cur.key] = cur.value;
|
|
25466
25508
|
return acc;
|
|
@@ -25517,7 +25559,7 @@ async function transformWxsFile(state, wxsPath) {
|
|
|
25517
25559
|
const { result, importees } = transformWxsCode(rawCode, {
|
|
25518
25560
|
filename: wxsPath
|
|
25519
25561
|
});
|
|
25520
|
-
if (typeof _optionalChain([result, 'optionalAccess',
|
|
25562
|
+
if (typeof _optionalChain([result, 'optionalAccess', _456 => _456.code]) === "string") {
|
|
25521
25563
|
code = result.code;
|
|
25522
25564
|
}
|
|
25523
25565
|
const dirname5 = _pathe2.default.dirname(wxsPath);
|
|
@@ -25606,13 +25648,13 @@ function createContextPlugin(ctx) {
|
|
|
25606
25648
|
}
|
|
25607
25649
|
function attachRuntimePlugins(ctx, plugins) {
|
|
25608
25650
|
const runtimePlugins = ctx[RUNTIME_PLUGINS_SYMBOL];
|
|
25609
|
-
if (!_optionalChain([runtimePlugins, 'optionalAccess',
|
|
25651
|
+
if (!_optionalChain([runtimePlugins, 'optionalAccess', _457 => _457.length])) {
|
|
25610
25652
|
return plugins;
|
|
25611
25653
|
}
|
|
25612
25654
|
return [...runtimePlugins, ...plugins];
|
|
25613
25655
|
}
|
|
25614
25656
|
function applyInspect(ctx, plugins) {
|
|
25615
|
-
const inspectOptions = _optionalChain([ctx, 'access',
|
|
25657
|
+
const inspectOptions = _optionalChain([ctx, 'access', _458 => _458.configService, 'access', _459 => _459.weappViteConfig, 'optionalAccess', _460 => _460.debug, 'optionalAccess', _461 => _461.inspect]);
|
|
25616
25658
|
if (!inspectOptions) {
|
|
25617
25659
|
return plugins;
|
|
25618
25660
|
}
|
|
@@ -25743,7 +25785,7 @@ function createMergeFactories(options) {
|
|
|
25743
25785
|
const currentOptions = getOptions2();
|
|
25744
25786
|
applyRuntimePlatform("miniprogram");
|
|
25745
25787
|
const external = [];
|
|
25746
|
-
if (_optionalChain([currentOptions, 'access',
|
|
25788
|
+
if (_optionalChain([currentOptions, 'access', _462 => _462.packageJson, 'optionalAccess', _463 => _463.dependencies])) {
|
|
25747
25789
|
external.push(
|
|
25748
25790
|
...Object.keys(currentOptions.packageJson.dependencies).map((pkg) => {
|
|
25749
25791
|
return new RegExp(`^${pkg.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&")}(\\/|$)`);
|
|
@@ -25758,7 +25800,7 @@ function createMergeFactories(options) {
|
|
|
25758
25800
|
const watchInclude = [
|
|
25759
25801
|
_pathe2.default.join(currentOptions.cwd, currentOptions.srcRoot, "**")
|
|
25760
25802
|
];
|
|
25761
|
-
const pluginRootConfig = _optionalChain([currentOptions, 'access',
|
|
25803
|
+
const pluginRootConfig = _optionalChain([currentOptions, 'access', _464 => _464.config, 'access', _465 => _465.weapp, 'optionalAccess', _466 => _466.pluginRoot]);
|
|
25762
25804
|
if (pluginRootConfig) {
|
|
25763
25805
|
const absolutePluginRoot = _pathe2.default.resolve(currentOptions.cwd, pluginRootConfig);
|
|
25764
25806
|
const relativeToSrc = _pathe2.default.relative(
|
|
@@ -25816,7 +25858,7 @@ function createMergeFactories(options) {
|
|
|
25816
25858
|
arrangePlugins(inlineConfig, subPackageMeta);
|
|
25817
25859
|
inlineConfig.logLevel = "info";
|
|
25818
25860
|
injectBuiltinAliases(inlineConfig);
|
|
25819
|
-
const currentRoot = _optionalChain([subPackageMeta, 'optionalAccess',
|
|
25861
|
+
const currentRoot = _optionalChain([subPackageMeta, 'optionalAccess', _467 => _467.subPackage, 'access', _468 => _468.root]);
|
|
25820
25862
|
setOptions({
|
|
25821
25863
|
...currentOptions,
|
|
25822
25864
|
currentSubPackageRoot: currentRoot
|
|
@@ -25827,7 +25869,7 @@ function createMergeFactories(options) {
|
|
|
25827
25869
|
ensureConfigService();
|
|
25828
25870
|
const currentOptions = getOptions2();
|
|
25829
25871
|
const web = currentOptions.weappWeb;
|
|
25830
|
-
if (!_optionalChain([web, 'optionalAccess',
|
|
25872
|
+
if (!_optionalChain([web, 'optionalAccess', _469 => _469.enabled])) {
|
|
25831
25873
|
return void 0;
|
|
25832
25874
|
}
|
|
25833
25875
|
applyRuntimePlatform("web");
|
|
@@ -25912,7 +25954,7 @@ function createConfigService(ctx) {
|
|
|
25912
25954
|
const toPosix3 = (value) => value.replace(/\\/g, "/");
|
|
25913
25955
|
const fromPosix = (value) => _pathe2.default.sep === "/" ? value : value.split("/").join(_pathe2.default.sep);
|
|
25914
25956
|
const resolveAbsolutePluginRoot = () => {
|
|
25915
|
-
const pluginRootConfig = _optionalChain([options, 'access',
|
|
25957
|
+
const pluginRootConfig = _optionalChain([options, 'access', _470 => _470.config, 'access', _471 => _471.weapp, 'optionalAccess', _472 => _472.pluginRoot]);
|
|
25916
25958
|
if (!pluginRootConfig) {
|
|
25917
25959
|
return void 0;
|
|
25918
25960
|
}
|
|
@@ -25930,7 +25972,7 @@ function createConfigService(ctx) {
|
|
|
25930
25972
|
if (!absolutePluginRoot) {
|
|
25931
25973
|
return void 0;
|
|
25932
25974
|
}
|
|
25933
|
-
const configured = _optionalChain([options, 'access',
|
|
25975
|
+
const configured = _optionalChain([options, 'access', _473 => _473.projectConfig, 'optionalAccess', _474 => _474.pluginRoot]);
|
|
25934
25976
|
if (configured) {
|
|
25935
25977
|
return _pathe2.default.resolve(options.cwd, configured);
|
|
25936
25978
|
}
|
|
@@ -25974,7 +26016,7 @@ function createConfigService(ctx) {
|
|
|
25974
26016
|
defineEnv[key] = value;
|
|
25975
26017
|
}
|
|
25976
26018
|
function getDefineImportMetaEnv() {
|
|
25977
|
-
const mpPlatform = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
26019
|
+
const mpPlatform = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _475 => _475.platform]), () => ( DEFAULT_MP_PLATFORM));
|
|
25978
26020
|
const resolvedPlatform = _nullishCoalesce(defineEnv.PLATFORM, () => ( mpPlatform));
|
|
25979
26021
|
const env = {
|
|
25980
26022
|
PLATFORM: resolvedPlatform,
|
|
@@ -25990,7 +26032,7 @@ function createConfigService(ctx) {
|
|
|
25990
26032
|
}
|
|
25991
26033
|
function applyRuntimePlatform(runtime) {
|
|
25992
26034
|
const isWeb = runtime === "web";
|
|
25993
|
-
const mpPlatform = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
26035
|
+
const mpPlatform = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _476 => _476.platform]), () => ( DEFAULT_MP_PLATFORM));
|
|
25994
26036
|
const resolvedPlatform = isWeb ? "web" : mpPlatform;
|
|
25995
26037
|
setDefineEnv("PLATFORM", resolvedPlatform);
|
|
25996
26038
|
setDefineEnv("IS_WEB", isWeb);
|
|
@@ -26101,7 +26143,7 @@ function createConfigService(ctx) {
|
|
|
26101
26143
|
return options.srcRoot;
|
|
26102
26144
|
},
|
|
26103
26145
|
get pluginRoot() {
|
|
26104
|
-
return _optionalChain([options, 'access',
|
|
26146
|
+
return _optionalChain([options, 'access', _477 => _477.config, 'access', _478 => _478.weapp, 'optionalAccess', _479 => _479.pluginRoot]);
|
|
26105
26147
|
},
|
|
26106
26148
|
get absolutePluginRoot() {
|
|
26107
26149
|
return resolveAbsolutePluginRoot();
|
|
@@ -26193,10 +26235,10 @@ function createJsonService(ctx) {
|
|
|
26193
26235
|
}
|
|
26194
26236
|
let resultJson;
|
|
26195
26237
|
if (/app\.json(?:\.[jt]s)?$/.test(filepath)) {
|
|
26196
|
-
await _optionalChain([ctx, 'access',
|
|
26238
|
+
await _optionalChain([ctx, 'access', _480 => _480.autoRoutesService, 'optionalAccess', _481 => _481.ensureFresh, 'call', _482 => _482()]);
|
|
26197
26239
|
}
|
|
26198
26240
|
if (/\.json\.[jt]s$/.test(filepath)) {
|
|
26199
|
-
const routesReference = _optionalChain([ctx, 'access',
|
|
26241
|
+
const routesReference = _optionalChain([ctx, 'access', _483 => _483.autoRoutesService, 'optionalAccess', _484 => _484.getReference, 'call', _485 => _485()]);
|
|
26200
26242
|
const fallbackRoutes = _nullishCoalesce(routesReference, () => ( { pages: [], entries: [], subPackages: [] }));
|
|
26201
26243
|
const routesModule = {
|
|
26202
26244
|
routes: fallbackRoutes,
|
|
@@ -26246,7 +26288,7 @@ function createJsonService(ctx) {
|
|
|
26246
26288
|
return resultJson;
|
|
26247
26289
|
} catch (error) {
|
|
26248
26290
|
logger_default.error(`\u6B8B\u7834\u7684JSON\u6587\u4EF6: ${filepath}`);
|
|
26249
|
-
_optionalChain([debug, 'optionalCall',
|
|
26291
|
+
_optionalChain([debug, 'optionalCall', _486 => _486(error)]);
|
|
26250
26292
|
}
|
|
26251
26293
|
}
|
|
26252
26294
|
function resolve8(entry) {
|
|
@@ -26301,7 +26343,7 @@ function createNpmService(ctx) {
|
|
|
26301
26343
|
if (!ctx.configService) {
|
|
26302
26344
|
throw new Error("configService must be initialized before writing npm cache");
|
|
26303
26345
|
}
|
|
26304
|
-
if (_optionalChain([ctx, 'access',
|
|
26346
|
+
if (_optionalChain([ctx, 'access', _487 => _487.configService, 'access', _488 => _488.weappViteConfig, 'optionalAccess', _489 => _489.npm, 'optionalAccess', _490 => _490.cache])) {
|
|
26305
26347
|
await _fsextra2.default.outputJSON(getDependenciesCacheFilePath(root), {
|
|
26306
26348
|
hash: dependenciesCacheHash()
|
|
26307
26349
|
});
|
|
@@ -26314,7 +26356,7 @@ function createNpmService(ctx) {
|
|
|
26314
26356
|
}
|
|
26315
26357
|
}
|
|
26316
26358
|
async function checkDependenciesCacheOutdate(root) {
|
|
26317
|
-
if (_optionalChain([ctx, 'access',
|
|
26359
|
+
if (_optionalChain([ctx, 'access', _491 => _491.configService, 'optionalAccess', _492 => _492.weappViteConfig, 'optionalAccess', _493 => _493.npm, 'optionalAccess', _494 => _494.cache])) {
|
|
26318
26360
|
const json = await readDependenciesCache(root);
|
|
26319
26361
|
if (_shared.isObject.call(void 0, json)) {
|
|
26320
26362
|
return dependenciesCacheHash() !== json.hash;
|
|
@@ -26347,7 +26389,7 @@ function createNpmService(ctx) {
|
|
|
26347
26389
|
target: "es6",
|
|
26348
26390
|
external: []
|
|
26349
26391
|
});
|
|
26350
|
-
const resolvedOptions = _optionalChain([ctx, 'access',
|
|
26392
|
+
const resolvedOptions = _optionalChain([ctx, 'access', _495 => _495.configService, 'optionalAccess', _496 => _496.weappViteConfig, 'optionalAccess', _497 => _497.npm, 'optionalAccess', _498 => _498.buildOptions, 'optionalCall', _499 => _499(
|
|
26351
26393
|
mergedOptions,
|
|
26352
26394
|
{ name, entry }
|
|
26353
26395
|
)]);
|
|
@@ -26447,7 +26489,7 @@ function createNpmService(ctx) {
|
|
|
26447
26489
|
throw new Error("configService must be initialized before resolving npm relation list");
|
|
26448
26490
|
}
|
|
26449
26491
|
let packNpmRelationList = [];
|
|
26450
|
-
if (_optionalChain([ctx, 'access',
|
|
26492
|
+
if (_optionalChain([ctx, 'access', _500 => _500.configService, 'access', _501 => _501.projectConfig, 'access', _502 => _502.setting, 'optionalAccess', _503 => _503.packNpmManually]) && Array.isArray(ctx.configService.projectConfig.setting.packNpmRelationList)) {
|
|
26451
26493
|
packNpmRelationList = ctx.configService.projectConfig.setting.packNpmRelationList;
|
|
26452
26494
|
} else {
|
|
26453
26495
|
packNpmRelationList = [
|
|
@@ -26460,10 +26502,10 @@ function createNpmService(ctx) {
|
|
|
26460
26502
|
return packNpmRelationList;
|
|
26461
26503
|
}
|
|
26462
26504
|
async function build3(options) {
|
|
26463
|
-
if (!_optionalChain([ctx, 'access',
|
|
26505
|
+
if (!_optionalChain([ctx, 'access', _504 => _504.configService, 'optionalAccess', _505 => _505.weappViteConfig, 'optionalAccess', _506 => _506.npm, 'optionalAccess', _507 => _507.enable])) {
|
|
26464
26506
|
return;
|
|
26465
26507
|
}
|
|
26466
|
-
_optionalChain([debug, 'optionalCall',
|
|
26508
|
+
_optionalChain([debug, 'optionalCall', _508 => _508("buildNpm start")]);
|
|
26467
26509
|
const packNpmRelationList = getPackNpmRelationList();
|
|
26468
26510
|
const [mainRelation, ...subRelations] = packNpmRelationList;
|
|
26469
26511
|
const packageJsonPath = _pathe2.default.resolve(ctx.configService.cwd, mainRelation.packageJsonPath);
|
|
@@ -26538,7 +26580,7 @@ function createNpmService(ctx) {
|
|
|
26538
26580
|
}
|
|
26539
26581
|
}
|
|
26540
26582
|
}
|
|
26541
|
-
_optionalChain([debug, 'optionalCall',
|
|
26583
|
+
_optionalChain([debug, 'optionalCall', _509 => _509("buildNpm end")]);
|
|
26542
26584
|
}
|
|
26543
26585
|
return {
|
|
26544
26586
|
getDependenciesCacheFilePath,
|
|
@@ -26582,7 +26624,7 @@ var TimeoutError = (_class16 = class _TimeoutError extends Error {
|
|
|
26582
26624
|
__init36() {this.name = "TimeoutError"}
|
|
26583
26625
|
constructor(message, options) {
|
|
26584
26626
|
super(message, options);_class16.prototype.__init36.call(this);;
|
|
26585
|
-
_optionalChain([Error, 'access',
|
|
26627
|
+
_optionalChain([Error, 'access', _510 => _510.captureStackTrace, 'optionalCall', _511 => _511(this, _TimeoutError)]);
|
|
26586
26628
|
}
|
|
26587
26629
|
}, _class16);
|
|
26588
26630
|
var getAbortedReason = (signal) => _nullishCoalesce(signal.reason, () => ( new DOMException("This operation was aborted.", "AbortError")));
|
|
@@ -26600,7 +26642,7 @@ function pTimeout(promise, options) {
|
|
|
26600
26642
|
if (typeof milliseconds !== "number" || Math.sign(milliseconds) !== 1) {
|
|
26601
26643
|
throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${milliseconds}\``);
|
|
26602
26644
|
}
|
|
26603
|
-
if (_optionalChain([signal, 'optionalAccess',
|
|
26645
|
+
if (_optionalChain([signal, 'optionalAccess', _512 => _512.aborted])) {
|
|
26604
26646
|
reject(getAbortedReason(signal));
|
|
26605
26647
|
return;
|
|
26606
26648
|
}
|
|
@@ -26698,7 +26740,7 @@ var PriorityQueue = class {
|
|
|
26698
26740
|
}
|
|
26699
26741
|
dequeue() {
|
|
26700
26742
|
const item = this.#queue.shift();
|
|
26701
|
-
return _optionalChain([item, 'optionalAccess',
|
|
26743
|
+
return _optionalChain([item, 'optionalAccess', _513 => _513.run]);
|
|
26702
26744
|
}
|
|
26703
26745
|
filter(options) {
|
|
26704
26746
|
return this.#queue.filter((element) => element.priority === options.priority).map((element) => element.run);
|
|
@@ -26759,10 +26801,10 @@ var PQueue = class extends import_index2.default {
|
|
|
26759
26801
|
...options
|
|
26760
26802
|
};
|
|
26761
26803
|
if (!(typeof options.intervalCap === "number" && options.intervalCap >= 1)) {
|
|
26762
|
-
throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${_nullishCoalesce(_optionalChain([options, 'access',
|
|
26804
|
+
throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${_nullishCoalesce(_optionalChain([options, 'access', _514 => _514.intervalCap, 'optionalAccess', _515 => _515.toString, 'call', _516 => _516()]), () => ( ""))}\` (${typeof options.intervalCap})`);
|
|
26763
26805
|
}
|
|
26764
26806
|
if (options.interval === void 0 || !(Number.isFinite(options.interval) && options.interval >= 0)) {
|
|
26765
|
-
throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${_nullishCoalesce(_optionalChain([options, 'access',
|
|
26807
|
+
throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${_nullishCoalesce(_optionalChain([options, 'access', _517 => _517.interval, 'optionalAccess', _518 => _518.toString, 'call', _519 => _519()]), () => ( ""))}\` (${typeof options.interval})`);
|
|
26766
26808
|
}
|
|
26767
26809
|
this.#carryoverIntervalCount = _nullishCoalesce(_nullishCoalesce(options.carryoverIntervalCount, () => ( options.carryoverConcurrencyCount)), () => ( false));
|
|
26768
26810
|
this.#isIntervalIgnored = options.intervalCap === Number.POSITIVE_INFINITY || options.interval === 0;
|
|
@@ -26963,7 +27005,7 @@ var PQueue = class extends import_index2.default {
|
|
|
26963
27005
|
let eventListener;
|
|
26964
27006
|
try {
|
|
26965
27007
|
try {
|
|
26966
|
-
_optionalChain([options, 'access',
|
|
27008
|
+
_optionalChain([options, 'access', _520 => _520.signal, 'optionalAccess', _521 => _521.throwIfAborted, 'call', _522 => _522()]);
|
|
26967
27009
|
} catch (error) {
|
|
26968
27010
|
if (!this.#isIntervalIgnored) {
|
|
26969
27011
|
this.#intervalCount--;
|
|
@@ -26995,7 +27037,7 @@ var PQueue = class extends import_index2.default {
|
|
|
26995
27037
|
this.emit("error", error);
|
|
26996
27038
|
} finally {
|
|
26997
27039
|
if (eventListener) {
|
|
26998
|
-
_optionalChain([options, 'access',
|
|
27040
|
+
_optionalChain([options, 'access', _523 => _523.signal, 'optionalAccess', _524 => _524.removeEventListener, 'call', _525 => _525("abort", eventListener)]);
|
|
26999
27041
|
}
|
|
27000
27042
|
this.#runningTasks.delete(taskSymbol);
|
|
27001
27043
|
queueMicrotask(() => {
|
|
@@ -27345,7 +27387,7 @@ var FileCache = class {
|
|
|
27345
27387
|
return true;
|
|
27346
27388
|
}
|
|
27347
27389
|
const cachedMtime = this.mtimeMap.get(id);
|
|
27348
|
-
const nextSignature = _optionalChain([options, 'optionalAccess',
|
|
27390
|
+
const nextSignature = _optionalChain([options, 'optionalAccess', _526 => _526.content]) !== void 0 ? createSignature(options.content) : void 0;
|
|
27349
27391
|
const updateSignature = () => {
|
|
27350
27392
|
if (nextSignature !== void 0) {
|
|
27351
27393
|
this.signatureMap.set(id, nextSignature);
|
|
@@ -27580,7 +27622,7 @@ function coerceStyleConfig(entry) {
|
|
|
27580
27622
|
if (!entry || typeof entry !== "object") {
|
|
27581
27623
|
return void 0;
|
|
27582
27624
|
}
|
|
27583
|
-
const source = _optionalChain([entry, 'access',
|
|
27625
|
+
const source = _optionalChain([entry, 'access', _527 => _527.source, 'optionalAccess', _528 => _528.toString, 'call', _529 => _529(), 'access', _530 => _530.trim, 'call', _531 => _531()]);
|
|
27584
27626
|
if (!source) {
|
|
27585
27627
|
return void 0;
|
|
27586
27628
|
}
|
|
@@ -27756,7 +27798,7 @@ function normalizeSubPackageStyleEntries(styles, subPackage, configService) {
|
|
|
27756
27798
|
if (!service) {
|
|
27757
27799
|
return void 0;
|
|
27758
27800
|
}
|
|
27759
|
-
const root = _optionalChain([subPackage, 'access',
|
|
27801
|
+
const root = _optionalChain([subPackage, 'access', _532 => _532.root, 'optionalAccess', _533 => _533.trim, 'call', _534 => _534()]);
|
|
27760
27802
|
if (!root) {
|
|
27761
27803
|
return void 0;
|
|
27762
27804
|
}
|
|
@@ -27864,7 +27906,7 @@ function createScanService(ctx) {
|
|
|
27864
27906
|
if (!ctx.configService) {
|
|
27865
27907
|
throw new Error("configService must be initialized before scanning subpackages");
|
|
27866
27908
|
}
|
|
27867
|
-
const json = _optionalChain([scanState, 'access',
|
|
27909
|
+
const json = _optionalChain([scanState, 'access', _535 => _535.appEntry, 'optionalAccess', _536 => _536.json]);
|
|
27868
27910
|
if (scanState.isDirty || subPackageMap.size === 0) {
|
|
27869
27911
|
subPackageMap.clear();
|
|
27870
27912
|
independentSubPackageMap.clear();
|
|
@@ -27882,16 +27924,16 @@ function createScanService(ctx) {
|
|
|
27882
27924
|
subPackage,
|
|
27883
27925
|
entries: resolveSubPackageEntries(subPackage)
|
|
27884
27926
|
};
|
|
27885
|
-
const subPackageConfig = _optionalChain([ctx, 'access',
|
|
27886
|
-
meta.subPackage.dependencies = _optionalChain([subPackageConfig, 'optionalAccess',
|
|
27887
|
-
meta.subPackage.inlineConfig = _optionalChain([subPackageConfig, 'optionalAccess',
|
|
27888
|
-
meta.autoImportComponents = _optionalChain([subPackageConfig, 'optionalAccess',
|
|
27927
|
+
const subPackageConfig = _optionalChain([ctx, 'access', _537 => _537.configService, 'access', _538 => _538.weappViteConfig, 'optionalAccess', _539 => _539.subPackages, 'optionalAccess', _540 => _540[subPackage.root]]);
|
|
27928
|
+
meta.subPackage.dependencies = _optionalChain([subPackageConfig, 'optionalAccess', _541 => _541.dependencies]);
|
|
27929
|
+
meta.subPackage.inlineConfig = _optionalChain([subPackageConfig, 'optionalAccess', _542 => _542.inlineConfig]);
|
|
27930
|
+
meta.autoImportComponents = _optionalChain([subPackageConfig, 'optionalAccess', _543 => _543.autoImportComponents]);
|
|
27889
27931
|
meta.styleEntries = normalizeSubPackageStyleEntries(
|
|
27890
|
-
_optionalChain([subPackageConfig, 'optionalAccess',
|
|
27932
|
+
_optionalChain([subPackageConfig, 'optionalAccess', _544 => _544.styles]),
|
|
27891
27933
|
subPackage,
|
|
27892
27934
|
ctx.configService
|
|
27893
27935
|
);
|
|
27894
|
-
meta.watchSharedStyles = _nullishCoalesce(_optionalChain([subPackageConfig, 'optionalAccess',
|
|
27936
|
+
meta.watchSharedStyles = _nullishCoalesce(_optionalChain([subPackageConfig, 'optionalAccess', _545 => _545.watchSharedStyles]), () => ( true));
|
|
27895
27937
|
metas.push(meta);
|
|
27896
27938
|
if (subPackage.root) {
|
|
27897
27939
|
subPackageMap.set(subPackage.root, meta);
|
|
@@ -27947,11 +27989,11 @@ function createScanService(ctx) {
|
|
|
27947
27989
|
loadSubPackages,
|
|
27948
27990
|
isMainPackageFileName,
|
|
27949
27991
|
get workersOptions() {
|
|
27950
|
-
return _optionalChain([scanState, 'access',
|
|
27992
|
+
return _optionalChain([scanState, 'access', _546 => _546.appEntry, 'optionalAccess', _547 => _547.json, 'optionalAccess', _548 => _548.workers]);
|
|
27951
27993
|
},
|
|
27952
27994
|
get workersDir() {
|
|
27953
|
-
const workersOptions = _optionalChain([scanState, 'access',
|
|
27954
|
-
return typeof workersOptions === "object" ? _optionalChain([workersOptions, 'optionalAccess',
|
|
27995
|
+
const workersOptions = _optionalChain([scanState, 'access', _549 => _549.appEntry, 'optionalAccess', _550 => _550.json, 'optionalAccess', _551 => _551.workers]);
|
|
27996
|
+
return typeof workersOptions === "object" ? _optionalChain([workersOptions, 'optionalAccess', _552 => _552.path]) : workersOptions;
|
|
27955
27997
|
},
|
|
27956
27998
|
markDirty() {
|
|
27957
27999
|
scanState.isDirty = true;
|
|
@@ -27998,7 +28040,7 @@ function createWatcherService(ctx) {
|
|
|
27998
28040
|
},
|
|
27999
28041
|
setRollupWatcher(watcher, root = "/") {
|
|
28000
28042
|
const oldWatcher = rollupWatcherMap.get(root);
|
|
28001
|
-
_optionalChain([oldWatcher, 'optionalAccess',
|
|
28043
|
+
_optionalChain([oldWatcher, 'optionalAccess', _553 => _553.close, 'call', _554 => _554()]);
|
|
28002
28044
|
rollupWatcherMap.set(root, watcher);
|
|
28003
28045
|
},
|
|
28004
28046
|
closeAll() {
|
|
@@ -28011,7 +28053,7 @@ function createWatcherService(ctx) {
|
|
|
28011
28053
|
});
|
|
28012
28054
|
});
|
|
28013
28055
|
sidecarWatcherMap.clear();
|
|
28014
|
-
void _optionalChain([ctx, 'access',
|
|
28056
|
+
void _optionalChain([ctx, 'access', _555 => _555.webService, 'optionalAccess', _556 => _556.close, 'call', _557 => _557(), 'access', _558 => _558.catch, 'call', _559 => _559(() => {
|
|
28015
28057
|
})]);
|
|
28016
28058
|
},
|
|
28017
28059
|
close(root = "/") {
|
|
@@ -28027,7 +28069,7 @@ function createWatcherService(ctx) {
|
|
|
28027
28069
|
sidecarWatcherMap.delete(root);
|
|
28028
28070
|
}
|
|
28029
28071
|
if (rollupWatcherMap.size === 0 && sidecarWatcherMap.size === 0) {
|
|
28030
|
-
void _optionalChain([ctx, 'access',
|
|
28072
|
+
void _optionalChain([ctx, 'access', _560 => _560.webService, 'optionalAccess', _561 => _561.close, 'call', _562 => _562(), 'access', _563 => _563.catch, 'call', _564 => _564(() => {
|
|
28031
28073
|
})]);
|
|
28032
28074
|
}
|
|
28033
28075
|
}
|
|
@@ -28040,7 +28082,7 @@ function createWatcherServicePlugin(ctx) {
|
|
|
28040
28082
|
name: "weapp-runtime:watcher-service",
|
|
28041
28083
|
closeBundle() {
|
|
28042
28084
|
const configService = ctx.configService;
|
|
28043
|
-
const isWatchMode = _optionalChain([configService, 'optionalAccess',
|
|
28085
|
+
const isWatchMode = _optionalChain([configService, 'optionalAccess', _565 => _565.isDev]) || Boolean(_optionalChain([configService, 'optionalAccess', _566 => _566.inlineConfig, 'optionalAccess', _567 => _567.build, 'optionalAccess', _568 => _568.watch]));
|
|
28044
28086
|
if (!isWatchMode) {
|
|
28045
28087
|
service.closeAll();
|
|
28046
28088
|
}
|
|
@@ -28057,10 +28099,10 @@ function createWebService(ctx) {
|
|
|
28057
28099
|
}
|
|
28058
28100
|
let devServer;
|
|
28059
28101
|
function isEnabled() {
|
|
28060
|
-
return Boolean(_optionalChain([ctx, 'access',
|
|
28102
|
+
return Boolean(_optionalChain([ctx, 'access', _569 => _569.configService, 'optionalAccess', _570 => _570.weappWebConfig, 'optionalAccess', _571 => _571.enabled]));
|
|
28061
28103
|
}
|
|
28062
28104
|
async function startDevServer() {
|
|
28063
|
-
if (!_optionalChain([ctx, 'access',
|
|
28105
|
+
if (!_optionalChain([ctx, 'access', _572 => _572.configService, 'optionalAccess', _573 => _573.isDev])) {
|
|
28064
28106
|
return void 0;
|
|
28065
28107
|
}
|
|
28066
28108
|
if (!isEnabled()) {
|
|
@@ -28069,7 +28111,7 @@ function createWebService(ctx) {
|
|
|
28069
28111
|
if (devServer) {
|
|
28070
28112
|
return devServer;
|
|
28071
28113
|
}
|
|
28072
|
-
const inlineConfig = _optionalChain([ctx, 'access',
|
|
28114
|
+
const inlineConfig = _optionalChain([ctx, 'access', _574 => _574.configService, 'optionalAccess', _575 => _575.mergeWeb, 'call', _576 => _576()]);
|
|
28073
28115
|
if (!inlineConfig) {
|
|
28074
28116
|
return void 0;
|
|
28075
28117
|
}
|
|
@@ -28082,7 +28124,7 @@ function createWebService(ctx) {
|
|
|
28082
28124
|
if (!isEnabled()) {
|
|
28083
28125
|
return void 0;
|
|
28084
28126
|
}
|
|
28085
|
-
const inlineConfig = _optionalChain([ctx, 'access',
|
|
28127
|
+
const inlineConfig = _optionalChain([ctx, 'access', _577 => _577.configService, 'optionalAccess', _578 => _578.mergeWeb, 'call', _579 => _579()]);
|
|
28086
28128
|
if (!inlineConfig) {
|
|
28087
28129
|
return void 0;
|
|
28088
28130
|
}
|
|
@@ -28112,7 +28154,7 @@ function createWebServicePlugin(ctx) {
|
|
|
28112
28154
|
return {
|
|
28113
28155
|
name: "weapp-runtime:web-service",
|
|
28114
28156
|
async closeBundle() {
|
|
28115
|
-
if (!_optionalChain([ctx, 'access',
|
|
28157
|
+
if (!_optionalChain([ctx, 'access', _580 => _580.configService, 'optionalAccess', _581 => _581.isDev])) {
|
|
28116
28158
|
await service.close();
|
|
28117
28159
|
}
|
|
28118
28160
|
}
|
|
@@ -30763,7 +30805,7 @@ function createWxmlService(ctx) {
|
|
|
30763
30805
|
return set3;
|
|
30764
30806
|
}
|
|
30765
30807
|
function clearAll() {
|
|
30766
|
-
const currentRoot = _optionalChain([ctx, 'access',
|
|
30808
|
+
const currentRoot = _optionalChain([ctx, 'access', _582 => _582.configService, 'optionalAccess', _583 => _583.currentSubPackageRoot]);
|
|
30767
30809
|
if (!currentRoot) {
|
|
30768
30810
|
depsMap.clear();
|
|
30769
30811
|
tokenMap.clear();
|
|
@@ -30822,7 +30864,7 @@ function createWxmlService(ctx) {
|
|
|
30822
30864
|
if (!ctx.configService) {
|
|
30823
30865
|
throw new Error("configService must be initialized before scanning wxml");
|
|
30824
30866
|
}
|
|
30825
|
-
const wxmlConfig = _nullishCoalesce(_optionalChain([ctx, 'access',
|
|
30867
|
+
const wxmlConfig = _nullishCoalesce(_optionalChain([ctx, 'access', _584 => _584.configService, 'access', _585 => _585.weappViteConfig, 'optionalAccess', _586 => _586.wxml]), () => ( _optionalChain([ctx, 'access', _587 => _587.configService, 'access', _588 => _588.weappViteConfig, 'optionalAccess', _589 => _589.enhance, 'optionalAccess', _590 => _590.wxml])));
|
|
30826
30868
|
return scanWxml(wxml, {
|
|
30827
30869
|
platform: ctx.configService.platform,
|
|
30828
30870
|
...wxmlConfig === true ? {} : wxmlConfig
|
package/dist/cli.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict"; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } async function _asyncNullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return await rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunk53HNLH2Ncjs = require('./chunk-53HNLH2N.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
@@ -11,7 +11,7 @@ var _chunk5OVHBJIBcjs = require('./chunk-5OVHBJIB.cjs');
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _chunkPYBV5NXOcjs = require('./chunk-PYBV5NXO.cjs');
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
@@ -618,7 +618,7 @@ var _buffer = require('buffer');
|
|
|
618
618
|
|
|
619
619
|
var _vite = require('vite');
|
|
620
620
|
var VIRTUAL_MODULE_INDICATOR = "\0";
|
|
621
|
-
var VIRTUAL_PREFIX = `${
|
|
621
|
+
var VIRTUAL_PREFIX = `${_chunkPYBV5NXOcjs.SHARED_CHUNK_VIRTUAL_PREFIX}/`;
|
|
622
622
|
function isPathInside(parent, candidate) {
|
|
623
623
|
if (!parent) {
|
|
624
624
|
return false;
|
|
@@ -981,7 +981,7 @@ async function analyzeSubpackages(ctx) {
|
|
|
981
981
|
};
|
|
982
982
|
const analysisConfig = configService.merge(
|
|
983
983
|
void 0,
|
|
984
|
-
|
|
984
|
+
_chunkPYBV5NXOcjs.createSharedBuildConfig.call(void 0, configService, scanService),
|
|
985
985
|
{
|
|
986
986
|
build: {
|
|
987
987
|
write: false,
|
|
@@ -1079,7 +1079,7 @@ async function waitForServerExit(server) {
|
|
|
1079
1079
|
try {
|
|
1080
1080
|
await server.close();
|
|
1081
1081
|
} catch (error) {
|
|
1082
|
-
|
|
1082
|
+
_chunkPYBV5NXOcjs.logger_default.error(error);
|
|
1083
1083
|
}
|
|
1084
1084
|
};
|
|
1085
1085
|
const signals = ["SIGINT", "SIGTERM"];
|
|
@@ -1157,16 +1157,16 @@ async function startAnalyzeDashboard(result, options) {
|
|
|
1157
1157
|
urls
|
|
1158
1158
|
};
|
|
1159
1159
|
if (_optionalChain([options, 'optionalAccess', _9 => _9.watch])) {
|
|
1160
|
-
|
|
1160
|
+
_chunkPYBV5NXOcjs.logger_default.info("\u5206\u6790\u4EEA\u8868\u76D8\u5DF2\u542F\u52A8\uFF08\u5B9E\u65F6\u6A21\u5F0F\uFF09\uFF0C\u6309 Ctrl+C \u9000\u51FA\u3002");
|
|
1161
1161
|
for (const url of handle.urls) {
|
|
1162
|
-
|
|
1162
|
+
_chunkPYBV5NXOcjs.logger_default.info(`\u5206\u5305\u5206\u6790\u4EEA\u8868\u76D8\uFF1A${url}`);
|
|
1163
1163
|
}
|
|
1164
1164
|
void waitPromise;
|
|
1165
1165
|
return handle;
|
|
1166
1166
|
}
|
|
1167
|
-
|
|
1167
|
+
_chunkPYBV5NXOcjs.logger_default.info("\u5206\u6790\u4EEA\u8868\u76D8\u5DF2\u542F\u52A8\uFF08\u9759\u6001\u6A21\u5F0F\uFF09\uFF0C\u6309 Ctrl+C \u9000\u51FA\u3002");
|
|
1168
1168
|
for (const url of handle.urls) {
|
|
1169
|
-
|
|
1169
|
+
_chunkPYBV5NXOcjs.logger_default.info(`\u5206\u5305\u5206\u6790\u4EEA\u8868\u76D8\uFF1A${url}`);
|
|
1170
1170
|
}
|
|
1171
1171
|
await waitPromise;
|
|
1172
1172
|
}
|
|
@@ -1223,7 +1223,7 @@ function coerceBooleanOption(value) {
|
|
|
1223
1223
|
// src/cli/runtime.ts
|
|
1224
1224
|
_chunkL34YWFZMcjs.init_cjs_shims.call(void 0, );
|
|
1225
1225
|
function logRuntimeTarget(targets) {
|
|
1226
|
-
|
|
1226
|
+
_chunkPYBV5NXOcjs.logger_default.info(`\u76EE\u6807\u5E73\u53F0\uFF1A${targets.label}`);
|
|
1227
1227
|
}
|
|
1228
1228
|
function resolveRuntimeTargets(options) {
|
|
1229
1229
|
const rawPlatform = typeof options.platform === "string" ? options.platform : typeof options.p === "string" ? options.p : void 0;
|
|
@@ -1231,17 +1231,17 @@ function resolveRuntimeTargets(options) {
|
|
|
1231
1231
|
return {
|
|
1232
1232
|
runMini: true,
|
|
1233
1233
|
runWeb: false,
|
|
1234
|
-
mpPlatform:
|
|
1235
|
-
label:
|
|
1234
|
+
mpPlatform: _chunkPYBV5NXOcjs.DEFAULT_MP_PLATFORM,
|
|
1235
|
+
label: _chunkPYBV5NXOcjs.DEFAULT_MP_PLATFORM
|
|
1236
1236
|
};
|
|
1237
1237
|
}
|
|
1238
|
-
const normalized =
|
|
1238
|
+
const normalized = _chunkPYBV5NXOcjs.normalizeMiniPlatform.call(void 0, rawPlatform);
|
|
1239
1239
|
if (!normalized) {
|
|
1240
1240
|
return {
|
|
1241
1241
|
runMini: true,
|
|
1242
1242
|
runWeb: false,
|
|
1243
|
-
mpPlatform:
|
|
1244
|
-
label:
|
|
1243
|
+
mpPlatform: _chunkPYBV5NXOcjs.DEFAULT_MP_PLATFORM,
|
|
1244
|
+
label: _chunkPYBV5NXOcjs.DEFAULT_MP_PLATFORM
|
|
1245
1245
|
};
|
|
1246
1246
|
}
|
|
1247
1247
|
if (normalized === "h5" || normalized === "web") {
|
|
@@ -1252,7 +1252,7 @@ function resolveRuntimeTargets(options) {
|
|
|
1252
1252
|
label: normalized === "h5" ? "h5" : "web"
|
|
1253
1253
|
};
|
|
1254
1254
|
}
|
|
1255
|
-
const mpPlatform =
|
|
1255
|
+
const mpPlatform = _chunkPYBV5NXOcjs.resolveMiniPlatform.call(void 0, normalized);
|
|
1256
1256
|
if (mpPlatform) {
|
|
1257
1257
|
return {
|
|
1258
1258
|
runMini: true,
|
|
@@ -1261,12 +1261,12 @@ function resolveRuntimeTargets(options) {
|
|
|
1261
1261
|
label: mpPlatform
|
|
1262
1262
|
};
|
|
1263
1263
|
}
|
|
1264
|
-
|
|
1264
|
+
_chunkPYBV5NXOcjs.logger_default.warn(`\u672A\u8BC6\u522B\u7684\u5E73\u53F0 "${rawPlatform}"\uFF0C\u5DF2\u56DE\u9000\u5230 ${_chunkPYBV5NXOcjs.DEFAULT_MP_PLATFORM}`);
|
|
1265
1265
|
return {
|
|
1266
1266
|
runMini: true,
|
|
1267
1267
|
runWeb: false,
|
|
1268
|
-
mpPlatform:
|
|
1269
|
-
label:
|
|
1268
|
+
mpPlatform: _chunkPYBV5NXOcjs.DEFAULT_MP_PLATFORM,
|
|
1269
|
+
label: _chunkPYBV5NXOcjs.DEFAULT_MP_PLATFORM
|
|
1270
1270
|
};
|
|
1271
1271
|
}
|
|
1272
1272
|
function createInlineConfig(mpPlatform) {
|
|
@@ -1294,15 +1294,15 @@ function printAnalysisSummary(result) {
|
|
|
1294
1294
|
packageModuleSet.set(pkgRef.packageId, set);
|
|
1295
1295
|
}
|
|
1296
1296
|
}
|
|
1297
|
-
|
|
1297
|
+
_chunkPYBV5NXOcjs.logger_default.success("\u5206\u5305\u5206\u6790\u5B8C\u6210");
|
|
1298
1298
|
for (const pkg of result.packages) {
|
|
1299
1299
|
const chunkCount = pkg.files.filter((file) => file.type === "chunk").length;
|
|
1300
1300
|
const assetCount = pkg.files.length - chunkCount;
|
|
1301
1301
|
const moduleCount = _nullishCoalesce(_optionalChain([packageModuleSet, 'access', _10 => _10.get, 'call', _11 => _11(pkg.id), 'optionalAccess', _12 => _12.size]), () => ( 0));
|
|
1302
|
-
|
|
1302
|
+
_chunkPYBV5NXOcjs.logger_default.info(`- ${pkg.label}\uFF1A${chunkCount} \u4E2A\u6A21\u5757\u4EA7\u7269\uFF0C${assetCount} \u4E2A\u8D44\u6E90\uFF0C\u8986\u76D6 ${moduleCount} \u4E2A\u6E90\u7801\u6A21\u5757`);
|
|
1303
1303
|
}
|
|
1304
1304
|
if (result.subPackages.length > 0) {
|
|
1305
|
-
|
|
1305
|
+
_chunkPYBV5NXOcjs.logger_default.info("\u5206\u5305\u914D\u7F6E\uFF1A");
|
|
1306
1306
|
for (const descriptor of result.subPackages) {
|
|
1307
1307
|
const segments = [descriptor.root];
|
|
1308
1308
|
if (descriptor.name) {
|
|
@@ -1311,15 +1311,15 @@ function printAnalysisSummary(result) {
|
|
|
1311
1311
|
if (descriptor.independent) {
|
|
1312
1312
|
segments.push("\u72EC\u7ACB\u6784\u5EFA");
|
|
1313
1313
|
}
|
|
1314
|
-
|
|
1314
|
+
_chunkPYBV5NXOcjs.logger_default.info(`- ${segments.join("\uFF0C")}`);
|
|
1315
1315
|
}
|
|
1316
1316
|
}
|
|
1317
1317
|
const duplicates = result.modules.filter((module) => module.packages.length > 1);
|
|
1318
1318
|
if (duplicates.length === 0) {
|
|
1319
|
-
|
|
1319
|
+
_chunkPYBV5NXOcjs.logger_default.info("\u672A\u68C0\u6D4B\u5230\u8DE8\u5305\u590D\u7528\u7684\u6E90\u7801\u6A21\u5757\u3002");
|
|
1320
1320
|
return;
|
|
1321
1321
|
}
|
|
1322
|
-
|
|
1322
|
+
_chunkPYBV5NXOcjs.logger_default.info(`\u8DE8\u5305\u590D\u7528/\u590D\u5236\u6E90\u7801\u5171 ${duplicates.length} \u9879\uFF1A`);
|
|
1323
1323
|
const limit = 10;
|
|
1324
1324
|
const entries = duplicates.slice(0, limit);
|
|
1325
1325
|
for (const module of entries) {
|
|
@@ -1327,10 +1327,10 @@ function printAnalysisSummary(result) {
|
|
|
1327
1327
|
const label = _nullishCoalesce(packageLabelMap.get(pkgRef.packageId), () => ( pkgRef.packageId));
|
|
1328
1328
|
return `${label} \u2192 ${pkgRef.files.join(", ")}`;
|
|
1329
1329
|
}).join("\uFF1B");
|
|
1330
|
-
|
|
1330
|
+
_chunkPYBV5NXOcjs.logger_default.info(`- ${module.source} (${module.sourceType})\uFF1A${placements}`);
|
|
1331
1331
|
}
|
|
1332
1332
|
if (duplicates.length > limit) {
|
|
1333
|
-
|
|
1333
|
+
_chunkPYBV5NXOcjs.logger_default.info(`- \u2026\u5176\u4F59 ${duplicates.length - limit} \u9879\u8BF7\u4F7F\u7528 \`weapp-vite analyze --json\` \u67E5\u770B`);
|
|
1334
1334
|
}
|
|
1335
1335
|
}
|
|
1336
1336
|
function registerAnalyzeCommand(cli2) {
|
|
@@ -1340,15 +1340,15 @@ function registerAnalyzeCommand(cli2) {
|
|
|
1340
1340
|
const targets = resolveRuntimeTargets(options);
|
|
1341
1341
|
logRuntimeTarget(targets);
|
|
1342
1342
|
if (!targets.runMini) {
|
|
1343
|
-
|
|
1343
|
+
_chunkPYBV5NXOcjs.logger_default.warn("\u5F53\u524D\u547D\u4EE4\u4EC5\u652F\u6301\u5C0F\u7A0B\u5E8F\u5E73\u53F0\uFF0C\u8BF7\u901A\u8FC7 --platform weapp \u6307\u5B9A\u76EE\u6807\u3002");
|
|
1344
1344
|
return;
|
|
1345
1345
|
}
|
|
1346
1346
|
if (targets.runWeb) {
|
|
1347
|
-
|
|
1347
|
+
_chunkPYBV5NXOcjs.logger_default.warn("\u5206\u6790\u547D\u4EE4\u6682\u4E0D\u652F\u6301 Web \u5E73\u53F0\uFF0C\u5C06\u5FFD\u7565\u76F8\u5173\u914D\u7F6E\u3002");
|
|
1348
1348
|
}
|
|
1349
1349
|
const inlineConfig = createInlineConfig(targets.mpPlatform);
|
|
1350
1350
|
try {
|
|
1351
|
-
const ctx = await
|
|
1351
|
+
const ctx = await _chunk53HNLH2Ncjs.createCompilerContext.call(void 0, {
|
|
1352
1352
|
cwd: root,
|
|
1353
1353
|
mode: _nullishCoalesce(options.mode, () => ( "production")),
|
|
1354
1354
|
configFile,
|
|
@@ -1366,7 +1366,7 @@ function registerAnalyzeCommand(cli2) {
|
|
|
1366
1366
|
await _fsextra2.default.writeFile(resolvedOutputPath, `${JSON.stringify(result, null, 2)}
|
|
1367
1367
|
`, "utf8");
|
|
1368
1368
|
const relativeOutput = configService ? configService.relativeCwd(resolvedOutputPath) : resolvedOutputPath;
|
|
1369
|
-
|
|
1369
|
+
_chunkPYBV5NXOcjs.logger_default.success(`\u5206\u6790\u7ED3\u679C\u5DF2\u5199\u5165 ${relativeOutput}`);
|
|
1370
1370
|
writtenPath = resolvedOutputPath;
|
|
1371
1371
|
}
|
|
1372
1372
|
if (outputJson) {
|
|
@@ -1379,7 +1379,7 @@ function registerAnalyzeCommand(cli2) {
|
|
|
1379
1379
|
await startAnalyzeDashboard(result);
|
|
1380
1380
|
}
|
|
1381
1381
|
} catch (error) {
|
|
1382
|
-
|
|
1382
|
+
_chunkPYBV5NXOcjs.logger_default.error(error);
|
|
1383
1383
|
_process2.default.exitCode = 1;
|
|
1384
1384
|
}
|
|
1385
1385
|
});
|
|
@@ -1537,15 +1537,15 @@ function logBuildAppFinish(configService, webServer, options = {}) {
|
|
|
1537
1537
|
const urls = webServer.resolvedUrls;
|
|
1538
1538
|
const candidates = urls ? [..._nullishCoalesce(urls.local, () => ( [])), ..._nullishCoalesce(urls.network, () => ( []))] : [];
|
|
1539
1539
|
if (candidates.length > 0) {
|
|
1540
|
-
|
|
1540
|
+
_chunkPYBV5NXOcjs.logger_default.success("Web \u8FD0\u884C\u65F6\u5DF2\u542F\u52A8\uFF0C\u6D4F\u89C8\u5668\u8BBF\u95EE\uFF1A");
|
|
1541
1541
|
for (const url of candidates) {
|
|
1542
|
-
|
|
1542
|
+
_chunkPYBV5NXOcjs.logger_default.info(` \u279C ${url}`);
|
|
1543
1543
|
}
|
|
1544
1544
|
} else {
|
|
1545
|
-
|
|
1545
|
+
_chunkPYBV5NXOcjs.logger_default.success("Web \u8FD0\u884C\u65F6\u5DF2\u542F\u52A8");
|
|
1546
1546
|
}
|
|
1547
1547
|
} else {
|
|
1548
|
-
|
|
1548
|
+
_chunkPYBV5NXOcjs.logger_default.success("Web \u8FD0\u884C\u65F6\u5DF2\u542F\u52A8");
|
|
1549
1549
|
}
|
|
1550
1550
|
logBuildAppFinishOnlyShowOnce = true;
|
|
1551
1551
|
return;
|
|
@@ -1559,19 +1559,19 @@ function logBuildAppFinish(configService, webServer, options = {}) {
|
|
|
1559
1559
|
args: ["run", "open"]
|
|
1560
1560
|
}));
|
|
1561
1561
|
const devCommand = `${command} ${args.join(" ")}`;
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1562
|
+
_chunkPYBV5NXOcjs.logger_default.success("\u5E94\u7528\u6784\u5EFA\u5B8C\u6210\uFF01\u9884\u89C8\u65B9\u5F0F ( `2` \u79CD\u9009\u5176\u4E00\u5373\u53EF)\uFF1A");
|
|
1563
|
+
_chunkPYBV5NXOcjs.logger_default.info(`\u6267\u884C \`${devCommand}\` \u53EF\u4EE5\u76F4\u63A5\u5728 \`\u5FAE\u4FE1\u5F00\u53D1\u8005\u5DE5\u5177\` \u91CC\u6253\u5F00\u5F53\u524D\u5E94\u7528`);
|
|
1564
|
+
_chunkPYBV5NXOcjs.logger_default.info("\u6216\u624B\u52A8\u6253\u5F00\u5FAE\u4FE1\u5F00\u53D1\u8005\u5DE5\u5177\uFF0C\u5BFC\u5165\u6839\u76EE\u5F55(`project.config.json` \u6587\u4EF6\u6240\u5728\u7684\u76EE\u5F55)\uFF0C\u5373\u53EF\u9884\u89C8\u6548\u679C");
|
|
1565
1565
|
if (!skipWeb && webServer) {
|
|
1566
1566
|
const urls = webServer.resolvedUrls;
|
|
1567
1567
|
const candidates = urls ? [..._nullishCoalesce(urls.local, () => ( [])), ..._nullishCoalesce(urls.network, () => ( []))] : [];
|
|
1568
1568
|
if (candidates.length > 0) {
|
|
1569
|
-
|
|
1569
|
+
_chunkPYBV5NXOcjs.logger_default.success("Web \u8FD0\u884C\u65F6\u5DF2\u542F\u52A8\uFF0C\u6D4F\u89C8\u5668\u8BBF\u95EE\uFF1A");
|
|
1570
1570
|
for (const url of candidates) {
|
|
1571
|
-
|
|
1571
|
+
_chunkPYBV5NXOcjs.logger_default.info(` \u279C ${url}`);
|
|
1572
1572
|
}
|
|
1573
1573
|
} else {
|
|
1574
|
-
|
|
1574
|
+
_chunkPYBV5NXOcjs.logger_default.success("Web \u8FD0\u884C\u65F6\u5DF2\u542F\u52A8");
|
|
1575
1575
|
}
|
|
1576
1576
|
}
|
|
1577
1577
|
logBuildAppFinishOnlyShowOnce = true;
|
|
@@ -1584,7 +1584,7 @@ async function openIde() {
|
|
|
1584
1584
|
try {
|
|
1585
1585
|
await _weappidecli.parse.call(void 0, ["open", "-p"]);
|
|
1586
1586
|
} catch (error) {
|
|
1587
|
-
|
|
1587
|
+
_chunkPYBV5NXOcjs.logger_default.error(error);
|
|
1588
1588
|
}
|
|
1589
1589
|
}
|
|
1590
1590
|
|
|
@@ -1605,7 +1605,7 @@ function registerBuildCommand(cli2) {
|
|
|
1605
1605
|
const targets = resolveRuntimeTargets(options);
|
|
1606
1606
|
logRuntimeTarget(targets);
|
|
1607
1607
|
const inlineConfig = createInlineConfig(targets.mpPlatform);
|
|
1608
|
-
const ctx = await
|
|
1608
|
+
const ctx = await _chunk53HNLH2Ncjs.createCompilerContext.call(void 0, {
|
|
1609
1609
|
cwd: root,
|
|
1610
1610
|
mode: _nullishCoalesce(options.mode, () => ( "production")),
|
|
1611
1611
|
configFile,
|
|
@@ -1625,9 +1625,9 @@ function registerBuildCommand(cli2) {
|
|
|
1625
1625
|
if (targets.runWeb && _optionalChain([webConfig, 'optionalAccess', _14 => _14.enabled])) {
|
|
1626
1626
|
try {
|
|
1627
1627
|
await _optionalChain([webService, 'optionalAccess', _15 => _15.build, 'call', _16 => _16()]);
|
|
1628
|
-
|
|
1628
|
+
_chunkPYBV5NXOcjs.logger_default.success(`Web \u6784\u5EFA\u5B8C\u6210\uFF0C\u8F93\u51FA\u76EE\u5F55\uFF1A${configService.relativeCwd(webConfig.outDir)}`);
|
|
1629
1629
|
} catch (error) {
|
|
1630
|
-
|
|
1630
|
+
_chunkPYBV5NXOcjs.logger_default.error(error);
|
|
1631
1631
|
throw error;
|
|
1632
1632
|
}
|
|
1633
1633
|
}
|
|
@@ -1758,7 +1758,7 @@ async function generate(options) {
|
|
|
1758
1758
|
for (const { code, fileName: fileName2 } of files) {
|
|
1759
1759
|
if (code !== void 0) {
|
|
1760
1760
|
await _fsextra2.default.outputFile(_pathe2.default.resolve(basepath, fileName2), code, "utf8");
|
|
1761
|
-
|
|
1761
|
+
_chunkPYBV5NXOcjs.logger_default.success(`${composePath(outDir, fileName2)} \u521B\u5EFA\u6210\u529F\uFF01`);
|
|
1762
1762
|
}
|
|
1763
1763
|
}
|
|
1764
1764
|
}
|
|
@@ -1780,7 +1780,7 @@ async function loadConfig(configFile) {
|
|
|
1780
1780
|
mode: "development"
|
|
1781
1781
|
};
|
|
1782
1782
|
const loaded = await _vite.loadConfigFromFile.call(void 0, configEnv, resolvedConfigFile, cwd);
|
|
1783
|
-
const weappConfigFilePath = await
|
|
1783
|
+
const weappConfigFilePath = await _chunkPYBV5NXOcjs.resolveWeappConfigFile.call(void 0, {
|
|
1784
1784
|
root: cwd,
|
|
1785
1785
|
specified: resolvedConfigFile
|
|
1786
1786
|
});
|
|
@@ -1833,7 +1833,7 @@ function registerGenerateCommand(cli2) {
|
|
|
1833
1833
|
fileName = "app";
|
|
1834
1834
|
}
|
|
1835
1835
|
if (filepath === void 0) {
|
|
1836
|
-
|
|
1836
|
+
_chunkPYBV5NXOcjs.logger_default.error("weapp-vite generate <outDir> \u547D\u4EE4\u5FC5\u987B\u4F20\u5165\u8DEF\u5F84\u53C2\u6570 outDir");
|
|
1837
1837
|
return;
|
|
1838
1838
|
}
|
|
1839
1839
|
if (options.page) {
|
|
@@ -1861,7 +1861,7 @@ function registerInitCommand(cli2) {
|
|
|
1861
1861
|
command: "weapp-vite"
|
|
1862
1862
|
});
|
|
1863
1863
|
} catch (error) {
|
|
1864
|
-
|
|
1864
|
+
_chunkPYBV5NXOcjs.logger_default.error(error);
|
|
1865
1865
|
}
|
|
1866
1866
|
});
|
|
1867
1867
|
}
|
|
@@ -1874,7 +1874,7 @@ function registerNpmCommand(cli2) {
|
|
|
1874
1874
|
try {
|
|
1875
1875
|
await _weappidecli.parse.call(void 0, ["build-npm", "-p"]);
|
|
1876
1876
|
} catch (error) {
|
|
1877
|
-
|
|
1877
|
+
_chunkPYBV5NXOcjs.logger_default.error(error);
|
|
1878
1878
|
}
|
|
1879
1879
|
});
|
|
1880
1880
|
}
|
|
@@ -1896,7 +1896,7 @@ function registerServeCommand(cli2) {
|
|
|
1896
1896
|
const targets = resolveRuntimeTargets(options);
|
|
1897
1897
|
logRuntimeTarget(targets);
|
|
1898
1898
|
const inlineConfig = createInlineConfig(targets.mpPlatform);
|
|
1899
|
-
const ctx = await
|
|
1899
|
+
const ctx = await _chunk53HNLH2Ncjs.createCompilerContext.call(void 0, {
|
|
1900
1900
|
cwd: root,
|
|
1901
1901
|
mode: _nullishCoalesce(options.mode, () => ( "development")),
|
|
1902
1902
|
isDev: true,
|
|
@@ -1940,7 +1940,7 @@ function registerServeCommand(cli2) {
|
|
|
1940
1940
|
try {
|
|
1941
1941
|
webServer = await _optionalChain([webService, 'optionalAccess', _39 => _39.startDevServer, 'call', _40 => _40()]);
|
|
1942
1942
|
} catch (error) {
|
|
1943
|
-
|
|
1943
|
+
_chunkPYBV5NXOcjs.logger_default.error(error);
|
|
1944
1944
|
throw error;
|
|
1945
1945
|
}
|
|
1946
1946
|
}
|
|
@@ -1961,7 +1961,7 @@ function registerServeCommand(cli2) {
|
|
|
1961
1961
|
// src/cli.ts
|
|
1962
1962
|
var cli = cac("weapp-vite");
|
|
1963
1963
|
try {
|
|
1964
|
-
|
|
1964
|
+
_chunkPYBV5NXOcjs.checkRuntime.call(void 0, {
|
|
1965
1965
|
bun: "0.0.0",
|
|
1966
1966
|
deno: "0.0.0",
|
|
1967
1967
|
node: "20.19.0"
|
|
@@ -1980,5 +1980,5 @@ registerNpmCommand(cli);
|
|
|
1980
1980
|
registerGenerateCommand(cli);
|
|
1981
1981
|
registerCreateCommand(cli);
|
|
1982
1982
|
cli.help();
|
|
1983
|
-
cli.version(
|
|
1983
|
+
cli.version(_chunkPYBV5NXOcjs.VERSION);
|
|
1984
1984
|
cli.parse();
|
package/dist/cli.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createCompilerContext
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-2G3CI4U3.mjs";
|
|
4
4
|
import {
|
|
5
5
|
DEFAULT_MP_PLATFORM,
|
|
6
6
|
SHARED_CHUNK_VIRTUAL_PREFIX,
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
normalizeMiniPlatform,
|
|
12
12
|
resolveMiniPlatform,
|
|
13
13
|
resolveWeappConfigFile
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-OUPZ22AZ.mjs";
|
|
15
15
|
import {
|
|
16
16
|
init_esm_shims
|
|
17
17
|
} from "./chunk-KYR4QU4G.mjs";
|
package/dist/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
3
|
+
var _chunk53HNLH2Ncjs = require('./chunk-53HNLH2N.cjs');
|
|
4
|
+
require('./chunk-PYBV5NXO.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
var _chunk4DCIL32Zcjs = require('./chunk-4DCIL32Z.cjs');
|
|
@@ -27,4 +27,4 @@ _chunkL34YWFZMcjs.init_cjs_shims.call(void 0, );
|
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
|
|
30
|
-
exports.createCompilerContext =
|
|
30
|
+
exports.createCompilerContext = _chunk53HNLH2Ncjs.createCompilerContext; exports.defineAppJson = _chunkGUSULIGYcjs.defineAppJson; exports.defineComponentJson = _chunkGUSULIGYcjs.defineComponentJson; exports.defineConfig = _chunk4DCIL32Zcjs.defineConfig; exports.definePageJson = _chunkGUSULIGYcjs.definePageJson; exports.defineSitemapJson = _chunkGUSULIGYcjs.defineSitemapJson; exports.defineThemeJson = _chunkGUSULIGYcjs.defineThemeJson;
|
package/dist/index.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "weapp-vite",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "5.11.
|
|
4
|
+
"version": "5.11.2",
|
|
5
5
|
"description": "weapp-vite 一个现代化的小程序打包工具",
|
|
6
6
|
"author": "ice breaker <1324318532@qq.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -93,31 +93,31 @@
|
|
|
93
93
|
"debug": "^4.4.3",
|
|
94
94
|
"fdir": "^6.5.0",
|
|
95
95
|
"fs-extra": "^11.3.2",
|
|
96
|
-
"oxc-parser": "^0.
|
|
96
|
+
"oxc-parser": "^0.102.0",
|
|
97
97
|
"oxc-walker": "^0.6.0",
|
|
98
98
|
"pathe": "^2.0.3",
|
|
99
99
|
"picomatch": "^4.0.3",
|
|
100
100
|
"postcss": "^8.5.6",
|
|
101
101
|
"rolldown": "1.0.0-beta.53",
|
|
102
|
-
"tsdown": "0.17.
|
|
103
|
-
"vite": "8.0.0-beta.
|
|
102
|
+
"tsdown": "0.17.2",
|
|
103
|
+
"vite": "8.0.0-beta.1",
|
|
104
104
|
"vite-tsconfig-paths": "^5.1.4",
|
|
105
105
|
"@weapp-core/init": "3.0.5",
|
|
106
|
-
"@weapp-core/logger": "2.0.0",
|
|
107
106
|
"@weapp-core/schematics": "4.0.0",
|
|
108
107
|
"@weapp-core/shared": "2.0.1",
|
|
109
108
|
"@weapp-vite/volar": "0.0.2",
|
|
109
|
+
"@weapp-core/logger": "2.0.0",
|
|
110
110
|
"@weapp-vite/web": "0.0.2",
|
|
111
|
-
"rolldown-require": "1.0.6",
|
|
112
111
|
"vite-plugin-performance": "1.0.0",
|
|
113
|
-
"weapp-ide-cli": "4.1.1"
|
|
112
|
+
"weapp-ide-cli": "4.1.1",
|
|
113
|
+
"rolldown-require": "1.0.6"
|
|
114
114
|
},
|
|
115
115
|
"publishConfig": {
|
|
116
116
|
"access": "public",
|
|
117
117
|
"registry": "https://registry.npmjs.org"
|
|
118
118
|
},
|
|
119
119
|
"devDependencies": {
|
|
120
|
-
"@oxc-project/types": "^0.
|
|
120
|
+
"@oxc-project/types": "^0.102.0",
|
|
121
121
|
"@tailwindcss/vite": "^4.1.17",
|
|
122
122
|
"@types/semver": "^7.7.1",
|
|
123
123
|
"@vitejs/plugin-vue": "^6.0.2",
|