weapp-vite 5.5.0 → 5.5.1
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-T4MUKDMP.mjs → chunk-2BJRVKKW.mjs} +4065 -3790
- package/dist/{chunk-QCLEMTCV.mjs → chunk-IFYXRQC3.mjs} +1 -1
- package/dist/{chunk-5GG5TEGR.cjs → chunk-PONRZBHY.cjs} +4077 -3802
- package/dist/{chunk-OWCDSB6F.cjs → chunk-XMPAHTOR.cjs} +4 -4
- package/dist/cli.cjs +35 -35
- package/dist/cli.mjs +2 -2
- package/dist/{config-DepC4j8j.d.ts → config-CUFqPmXh.d.ts} +15 -1
- package/dist/{config-CzCzK7Jh.d.cts → config-Qcwf5OzO.d.cts} +15 -1
- package/dist/config.d.cts +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/index.cjs +3 -3
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.mjs +2 -2
- package/dist/json.d.cts +1 -1
- package/dist/json.d.ts +1 -1
- package/dist/types.d.cts +1 -1
- package/dist/types.d.ts +1 -1
- package/package.json +4 -4
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunkPONRZBHYcjs = require('./chunk-PONRZBHY.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
var _chunkOS76JPG2cjs = require('./chunk-OS76JPG2.cjs');
|
|
@@ -12,10 +12,10 @@ _chunkOS76JPG2cjs.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
|
+
_chunkPONRZBHYcjs.resetCompilerContext.call(void 0, key);
|
|
16
16
|
}
|
|
17
|
-
|
|
18
|
-
const ctx =
|
|
17
|
+
_chunkPONRZBHYcjs.setActiveCompilerContextKey.call(void 0, key);
|
|
18
|
+
const ctx = _chunkPONRZBHYcjs.getCompilerContext.call(void 0, key);
|
|
19
19
|
const { configService, scanService, autoRoutesService } = ctx;
|
|
20
20
|
await configService.load(options);
|
|
21
21
|
if (autoRoutesService) {
|
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(); } } 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 _chunkXMPAHTORcjs = require('./chunk-XMPAHTOR.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
@@ -9,7 +9,7 @@ var _chunkOWCDSB6Fcjs = require('./chunk-OWCDSB6F.cjs');
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunkPONRZBHYcjs = require('./chunk-PONRZBHY.cjs');
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
var _chunkOS76JPG2cjs = require('./chunk-OS76JPG2.cjs');
|
|
@@ -817,7 +817,7 @@ async function generate(options) {
|
|
|
817
817
|
for (const { code, fileName: fileName2 } of files) {
|
|
818
818
|
if (code !== void 0) {
|
|
819
819
|
await _fsextra2.default.outputFile(_pathe2.default.resolve(basepath, fileName2), code, "utf8");
|
|
820
|
-
|
|
820
|
+
_chunkPONRZBHYcjs.logger_default.success(`${composePath(outDir, fileName2)} \u521B\u5EFA\u6210\u529F\uFF01`);
|
|
821
821
|
}
|
|
822
822
|
}
|
|
823
823
|
}
|
|
@@ -855,7 +855,7 @@ async function readTemplateFile(templatePath, context) {
|
|
|
855
855
|
// src/cli.ts
|
|
856
856
|
var cli = cac("weapp-vite");
|
|
857
857
|
try {
|
|
858
|
-
|
|
858
|
+
_chunkPONRZBHYcjs.checkRuntime.call(void 0, {
|
|
859
859
|
bun: "0.0.0",
|
|
860
860
|
deno: "0.0.0",
|
|
861
861
|
node: "20.19.0"
|
|
@@ -873,7 +873,7 @@ async function loadConfig(configFile) {
|
|
|
873
873
|
mode: "development"
|
|
874
874
|
};
|
|
875
875
|
const loaded = await _vite.loadConfigFromFile.call(void 0, configEnv, resolvedConfigFile, cwd);
|
|
876
|
-
const weappConfigFilePath = await
|
|
876
|
+
const weappConfigFilePath = await _chunkPONRZBHYcjs.resolveWeappConfigFile.call(void 0, {
|
|
877
877
|
root: cwd,
|
|
878
878
|
specified: resolvedConfigFile
|
|
879
879
|
});
|
|
@@ -921,15 +921,15 @@ function logBuildAppFinish(configService, webServer, options = {}) {
|
|
|
921
921
|
const urls = webServer.resolvedUrls;
|
|
922
922
|
const candidates = urls ? [..._nullishCoalesce(urls.local, () => ( [])), ..._nullishCoalesce(urls.network, () => ( []))] : [];
|
|
923
923
|
if (candidates.length > 0) {
|
|
924
|
-
|
|
924
|
+
_chunkPONRZBHYcjs.logger_default.success("Web \u8FD0\u884C\u65F6\u5DF2\u542F\u52A8\uFF0C\u6D4F\u89C8\u5668\u8BBF\u95EE\uFF1A");
|
|
925
925
|
for (const url of candidates) {
|
|
926
|
-
|
|
926
|
+
_chunkPONRZBHYcjs.logger_default.info(` \u279C ${url}`);
|
|
927
927
|
}
|
|
928
928
|
} else {
|
|
929
|
-
|
|
929
|
+
_chunkPONRZBHYcjs.logger_default.success("Web \u8FD0\u884C\u65F6\u5DF2\u542F\u52A8");
|
|
930
930
|
}
|
|
931
931
|
} else {
|
|
932
|
-
|
|
932
|
+
_chunkPONRZBHYcjs.logger_default.success("Web \u8FD0\u884C\u65F6\u5DF2\u542F\u52A8");
|
|
933
933
|
}
|
|
934
934
|
logBuildAppFinishOnlyShowOnce = true;
|
|
935
935
|
return;
|
|
@@ -943,19 +943,19 @@ function logBuildAppFinish(configService, webServer, options = {}) {
|
|
|
943
943
|
args: ["run", "open"]
|
|
944
944
|
}));
|
|
945
945
|
const devCommand = `${command} ${args.join(" ")}`;
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
946
|
+
_chunkPONRZBHYcjs.logger_default.success("\u5E94\u7528\u6784\u5EFA\u5B8C\u6210\uFF01\u9884\u89C8\u65B9\u5F0F ( `2` \u79CD\u9009\u5176\u4E00\u5373\u53EF)\uFF1A");
|
|
947
|
+
_chunkPONRZBHYcjs.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`);
|
|
948
|
+
_chunkPONRZBHYcjs.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");
|
|
949
949
|
if (!skipWeb && webServer) {
|
|
950
950
|
const urls = webServer.resolvedUrls;
|
|
951
951
|
const candidates = urls ? [..._nullishCoalesce(urls.local, () => ( [])), ..._nullishCoalesce(urls.network, () => ( []))] : [];
|
|
952
952
|
if (candidates.length > 0) {
|
|
953
|
-
|
|
953
|
+
_chunkPONRZBHYcjs.logger_default.success("Web \u8FD0\u884C\u65F6\u5DF2\u542F\u52A8\uFF0C\u6D4F\u89C8\u5668\u8BBF\u95EE\uFF1A");
|
|
954
954
|
for (const url of candidates) {
|
|
955
|
-
|
|
955
|
+
_chunkPONRZBHYcjs.logger_default.info(` \u279C ${url}`);
|
|
956
956
|
}
|
|
957
957
|
} else {
|
|
958
|
-
|
|
958
|
+
_chunkPONRZBHYcjs.logger_default.success("Web \u8FD0\u884C\u65F6\u5DF2\u542F\u52A8");
|
|
959
959
|
}
|
|
960
960
|
}
|
|
961
961
|
logBuildAppFinishOnlyShowOnce = true;
|
|
@@ -985,11 +985,11 @@ async function openIde() {
|
|
|
985
985
|
try {
|
|
986
986
|
await _weappidecli.parse.call(void 0, ["open", "-p"]);
|
|
987
987
|
} catch (error) {
|
|
988
|
-
|
|
988
|
+
_chunkPONRZBHYcjs.logger_default.error(error);
|
|
989
989
|
}
|
|
990
990
|
}
|
|
991
991
|
function logRuntimeTarget(targets) {
|
|
992
|
-
|
|
992
|
+
_chunkPONRZBHYcjs.logger_default.info(`\u76EE\u6807\u5E73\u53F0\uFF1A${targets.label}`);
|
|
993
993
|
}
|
|
994
994
|
function resolveRuntimeTargets(options) {
|
|
995
995
|
const rawPlatform = typeof options.platform === "string" ? options.platform : typeof options.p === "string" ? options.p : void 0;
|
|
@@ -997,17 +997,17 @@ function resolveRuntimeTargets(options) {
|
|
|
997
997
|
return {
|
|
998
998
|
runMini: true,
|
|
999
999
|
runWeb: false,
|
|
1000
|
-
mpPlatform:
|
|
1001
|
-
label:
|
|
1000
|
+
mpPlatform: _chunkPONRZBHYcjs.DEFAULT_MP_PLATFORM,
|
|
1001
|
+
label: _chunkPONRZBHYcjs.DEFAULT_MP_PLATFORM
|
|
1002
1002
|
};
|
|
1003
1003
|
}
|
|
1004
|
-
const normalized =
|
|
1004
|
+
const normalized = _chunkPONRZBHYcjs.normalizeMiniPlatform.call(void 0, rawPlatform);
|
|
1005
1005
|
if (!normalized) {
|
|
1006
1006
|
return {
|
|
1007
1007
|
runMini: true,
|
|
1008
1008
|
runWeb: false,
|
|
1009
|
-
mpPlatform:
|
|
1010
|
-
label:
|
|
1009
|
+
mpPlatform: _chunkPONRZBHYcjs.DEFAULT_MP_PLATFORM,
|
|
1010
|
+
label: _chunkPONRZBHYcjs.DEFAULT_MP_PLATFORM
|
|
1011
1011
|
};
|
|
1012
1012
|
}
|
|
1013
1013
|
if (normalized === "h5" || normalized === "web") {
|
|
@@ -1018,7 +1018,7 @@ function resolveRuntimeTargets(options) {
|
|
|
1018
1018
|
label: normalized === "h5" ? "h5" : "web"
|
|
1019
1019
|
};
|
|
1020
1020
|
}
|
|
1021
|
-
const mpPlatform =
|
|
1021
|
+
const mpPlatform = _chunkPONRZBHYcjs.resolveMiniPlatform.call(void 0, normalized);
|
|
1022
1022
|
if (mpPlatform) {
|
|
1023
1023
|
return {
|
|
1024
1024
|
runMini: true,
|
|
@@ -1027,12 +1027,12 @@ function resolveRuntimeTargets(options) {
|
|
|
1027
1027
|
label: mpPlatform
|
|
1028
1028
|
};
|
|
1029
1029
|
}
|
|
1030
|
-
|
|
1030
|
+
_chunkPONRZBHYcjs.logger_default.warn(`\u672A\u8BC6\u522B\u7684\u5E73\u53F0 "${rawPlatform}"\uFF0C\u5DF2\u56DE\u9000\u5230 ${_chunkPONRZBHYcjs.DEFAULT_MP_PLATFORM}`);
|
|
1031
1031
|
return {
|
|
1032
1032
|
runMini: true,
|
|
1033
1033
|
runWeb: false,
|
|
1034
|
-
mpPlatform:
|
|
1035
|
-
label:
|
|
1034
|
+
mpPlatform: _chunkPONRZBHYcjs.DEFAULT_MP_PLATFORM,
|
|
1035
|
+
label: _chunkPONRZBHYcjs.DEFAULT_MP_PLATFORM
|
|
1036
1036
|
};
|
|
1037
1037
|
}
|
|
1038
1038
|
function createInlineConfig(mpPlatform) {
|
|
@@ -1054,7 +1054,7 @@ cli.command("[root]", "start dev server").alias("serve").alias("dev").option("--
|
|
|
1054
1054
|
const targets = resolveRuntimeTargets(options);
|
|
1055
1055
|
logRuntimeTarget(targets);
|
|
1056
1056
|
const inlineConfig = createInlineConfig(targets.mpPlatform);
|
|
1057
|
-
const { buildService, configService, webService } = await
|
|
1057
|
+
const { buildService, configService, webService } = await _chunkXMPAHTORcjs.createCompilerContext.call(void 0, {
|
|
1058
1058
|
cwd: root,
|
|
1059
1059
|
mode: _nullishCoalesce(options.mode, () => ( "development")),
|
|
1060
1060
|
isDev: true,
|
|
@@ -1069,7 +1069,7 @@ cli.command("[root]", "start dev server").alias("serve").alias("dev").option("--
|
|
|
1069
1069
|
try {
|
|
1070
1070
|
webServer = await _optionalChain([webService, 'optionalAccess', _15 => _15.startDevServer, 'call', _16 => _16()]);
|
|
1071
1071
|
} catch (error) {
|
|
1072
|
-
|
|
1072
|
+
_chunkPONRZBHYcjs.logger_default.error(error);
|
|
1073
1073
|
throw error;
|
|
1074
1074
|
}
|
|
1075
1075
|
}
|
|
@@ -1097,7 +1097,7 @@ cli.command("build [root]", "build for production").option("--target <target>",
|
|
|
1097
1097
|
const targets = resolveRuntimeTargets(options);
|
|
1098
1098
|
logRuntimeTarget(targets);
|
|
1099
1099
|
const inlineConfig = createInlineConfig(targets.mpPlatform);
|
|
1100
|
-
const { buildService, configService, webService } = await
|
|
1100
|
+
const { buildService, configService, webService } = await _chunkXMPAHTORcjs.createCompilerContext.call(void 0, {
|
|
1101
1101
|
cwd: root,
|
|
1102
1102
|
mode: _nullishCoalesce(options.mode, () => ( "production")),
|
|
1103
1103
|
configFile,
|
|
@@ -1110,9 +1110,9 @@ cli.command("build [root]", "build for production").option("--target <target>",
|
|
|
1110
1110
|
if (targets.runWeb && _optionalChain([webConfig, 'optionalAccess', _17 => _17.enabled])) {
|
|
1111
1111
|
try {
|
|
1112
1112
|
await _optionalChain([webService, 'optionalAccess', _18 => _18.build, 'call', _19 => _19()]);
|
|
1113
|
-
|
|
1113
|
+
_chunkPONRZBHYcjs.logger_default.success(`Web \u6784\u5EFA\u5B8C\u6210\uFF0C\u8F93\u51FA\u76EE\u5F55\uFF1A${configService.relativeCwd(webConfig.outDir)}`);
|
|
1114
1114
|
} catch (error) {
|
|
1115
|
-
|
|
1115
|
+
_chunkPONRZBHYcjs.logger_default.error(error);
|
|
1116
1116
|
throw error;
|
|
1117
1117
|
}
|
|
1118
1118
|
}
|
|
@@ -1129,7 +1129,7 @@ cli.command("init").action(async () => {
|
|
|
1129
1129
|
command: "weapp-vite"
|
|
1130
1130
|
});
|
|
1131
1131
|
} catch (error) {
|
|
1132
|
-
|
|
1132
|
+
_chunkPONRZBHYcjs.logger_default.error(error);
|
|
1133
1133
|
}
|
|
1134
1134
|
});
|
|
1135
1135
|
cli.command("open").action(async () => {
|
|
@@ -1139,7 +1139,7 @@ cli.command("npm").alias("build:npm").alias("build-npm").action(async () => {
|
|
|
1139
1139
|
try {
|
|
1140
1140
|
await _weappidecli.parse.call(void 0, ["build-npm", "-p"]);
|
|
1141
1141
|
} catch (error) {
|
|
1142
|
-
|
|
1142
|
+
_chunkPONRZBHYcjs.logger_default.error(error);
|
|
1143
1143
|
}
|
|
1144
1144
|
});
|
|
1145
1145
|
cli.command("g [filepath]", "generate component").alias("generate").option("-a, --app", "type app").option("-p, --page", "type app").option("-n, --name <name>", "filename").action(async (filepath, options) => {
|
|
@@ -1154,7 +1154,7 @@ cli.command("g [filepath]", "generate component").alias("generate").option("-a,
|
|
|
1154
1154
|
fileName = "app";
|
|
1155
1155
|
}
|
|
1156
1156
|
if (filepath === void 0) {
|
|
1157
|
-
|
|
1157
|
+
_chunkPONRZBHYcjs.logger_default.error("weapp-vite generate <outDir> \u547D\u4EE4\u5FC5\u987B\u4F20\u5165\u8DEF\u5F84\u53C2\u6570 outDir");
|
|
1158
1158
|
return;
|
|
1159
1159
|
}
|
|
1160
1160
|
if (options.page) {
|
|
@@ -1174,5 +1174,5 @@ cli.command("create [outDir]", "create project").option("-t, --template <type>",
|
|
|
1174
1174
|
await _init.createProject.call(void 0, outDir, options.template);
|
|
1175
1175
|
});
|
|
1176
1176
|
cli.help();
|
|
1177
|
-
cli.version(
|
|
1177
|
+
cli.version(_chunkPONRZBHYcjs.VERSION);
|
|
1178
1178
|
cli.parse();
|
package/dist/cli.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createCompilerContext
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-IFYXRQC3.mjs";
|
|
4
4
|
import {
|
|
5
5
|
DEFAULT_MP_PLATFORM,
|
|
6
6
|
VERSION,
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
normalizeMiniPlatform,
|
|
10
10
|
resolveMiniPlatform,
|
|
11
11
|
resolveWeappConfigFile
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-2BJRVKKW.mjs";
|
|
13
13
|
import {
|
|
14
14
|
init_esm_shims
|
|
15
15
|
} from "./chunk-7MAZ2JUY.mjs";
|
|
@@ -215,6 +215,11 @@ interface ChunksConfig {
|
|
|
215
215
|
* @default 'duplicate'
|
|
216
216
|
*/
|
|
217
217
|
sharedStrategy?: SharedChunkStrategy;
|
|
218
|
+
/**
|
|
219
|
+
* @description 是否输出分包优化日志,帮助确认共享模块被复制或回退的位置
|
|
220
|
+
* @default true
|
|
221
|
+
*/
|
|
222
|
+
logOptimization?: boolean;
|
|
218
223
|
}
|
|
219
224
|
interface WeappViteConfig {
|
|
220
225
|
/**
|
|
@@ -477,6 +482,7 @@ interface ConfigService {
|
|
|
477
482
|
mergeWorkers: (...configs: Partial<InlineConfig>[]) => InlineConfig;
|
|
478
483
|
merge: (subPackageMeta?: SubPackageMetaValue, ...configs: Partial<InlineConfig | undefined>[]) => InlineConfig;
|
|
479
484
|
mergeWeb: (...configs: Partial<InlineConfig | undefined>[]) => InlineConfig | undefined;
|
|
485
|
+
mergeInlineConfig: (...configs: Partial<InlineConfig>[]) => InlineConfig;
|
|
480
486
|
readonly defineImportMetaEnv: Record<string, any>;
|
|
481
487
|
readonly cwd: string;
|
|
482
488
|
readonly isDev: boolean;
|
|
@@ -512,6 +518,12 @@ interface ResolvedWeappWebConfig {
|
|
|
512
518
|
source?: WeappWebConfig;
|
|
513
519
|
}
|
|
514
520
|
|
|
521
|
+
interface JsonResolvableEntry {
|
|
522
|
+
json?: any;
|
|
523
|
+
jsonPath?: string;
|
|
524
|
+
type?: 'app' | 'page' | 'component' | 'plugin';
|
|
525
|
+
}
|
|
526
|
+
|
|
515
527
|
type HashInput = string | Buffer;
|
|
516
528
|
declare class FileCache<T extends object> {
|
|
517
529
|
cache: LRUCache<string, T>;
|
|
@@ -528,7 +540,7 @@ declare class FileCache<T extends object> {
|
|
|
528
540
|
|
|
529
541
|
interface JsonService {
|
|
530
542
|
read: (filepath: string) => Promise<any>;
|
|
531
|
-
resolve: (entry:
|
|
543
|
+
resolve: (entry: JsonResolvableEntry) => string | undefined;
|
|
532
544
|
cache: FileCache<any>;
|
|
533
545
|
}
|
|
534
546
|
|
|
@@ -639,6 +651,7 @@ interface RuntimeState {
|
|
|
639
651
|
independentSubPackageMap: Map<string, SubPackageMetaValue>;
|
|
640
652
|
appEntry?: AppEntry;
|
|
641
653
|
pluginJson?: Plugin;
|
|
654
|
+
pluginJsonPath?: string;
|
|
642
655
|
isDirty: boolean;
|
|
643
656
|
independentDirtyRoots: Set<string>;
|
|
644
657
|
};
|
|
@@ -653,6 +666,7 @@ interface RuntimeState {
|
|
|
653
666
|
interface ScanService {
|
|
654
667
|
appEntry?: AppEntry;
|
|
655
668
|
pluginJson?: Plugin;
|
|
669
|
+
pluginJsonPath?: string;
|
|
656
670
|
subPackageMap: Map<string, SubPackageMetaValue>;
|
|
657
671
|
independentSubPackageMap: Map<string, SubPackageMetaValue>;
|
|
658
672
|
loadAppEntry: () => Promise<AppEntry>;
|
|
@@ -215,6 +215,11 @@ interface ChunksConfig {
|
|
|
215
215
|
* @default 'duplicate'
|
|
216
216
|
*/
|
|
217
217
|
sharedStrategy?: SharedChunkStrategy;
|
|
218
|
+
/**
|
|
219
|
+
* @description 是否输出分包优化日志,帮助确认共享模块被复制或回退的位置
|
|
220
|
+
* @default true
|
|
221
|
+
*/
|
|
222
|
+
logOptimization?: boolean;
|
|
218
223
|
}
|
|
219
224
|
interface WeappViteConfig {
|
|
220
225
|
/**
|
|
@@ -477,6 +482,7 @@ interface ConfigService {
|
|
|
477
482
|
mergeWorkers: (...configs: Partial<InlineConfig>[]) => InlineConfig;
|
|
478
483
|
merge: (subPackageMeta?: SubPackageMetaValue, ...configs: Partial<InlineConfig | undefined>[]) => InlineConfig;
|
|
479
484
|
mergeWeb: (...configs: Partial<InlineConfig | undefined>[]) => InlineConfig | undefined;
|
|
485
|
+
mergeInlineConfig: (...configs: Partial<InlineConfig>[]) => InlineConfig;
|
|
480
486
|
readonly defineImportMetaEnv: Record<string, any>;
|
|
481
487
|
readonly cwd: string;
|
|
482
488
|
readonly isDev: boolean;
|
|
@@ -512,6 +518,12 @@ interface ResolvedWeappWebConfig {
|
|
|
512
518
|
source?: WeappWebConfig;
|
|
513
519
|
}
|
|
514
520
|
|
|
521
|
+
interface JsonResolvableEntry {
|
|
522
|
+
json?: any;
|
|
523
|
+
jsonPath?: string;
|
|
524
|
+
type?: 'app' | 'page' | 'component' | 'plugin';
|
|
525
|
+
}
|
|
526
|
+
|
|
515
527
|
type HashInput = string | Buffer;
|
|
516
528
|
declare class FileCache<T extends object> {
|
|
517
529
|
cache: LRUCache<string, T>;
|
|
@@ -528,7 +540,7 @@ declare class FileCache<T extends object> {
|
|
|
528
540
|
|
|
529
541
|
interface JsonService {
|
|
530
542
|
read: (filepath: string) => Promise<any>;
|
|
531
|
-
resolve: (entry:
|
|
543
|
+
resolve: (entry: JsonResolvableEntry) => string | undefined;
|
|
532
544
|
cache: FileCache<any>;
|
|
533
545
|
}
|
|
534
546
|
|
|
@@ -639,6 +651,7 @@ interface RuntimeState {
|
|
|
639
651
|
independentSubPackageMap: Map<string, SubPackageMetaValue>;
|
|
640
652
|
appEntry?: AppEntry;
|
|
641
653
|
pluginJson?: Plugin;
|
|
654
|
+
pluginJsonPath?: string;
|
|
642
655
|
isDirty: boolean;
|
|
643
656
|
independentDirtyRoots: Set<string>;
|
|
644
657
|
};
|
|
@@ -653,6 +666,7 @@ interface RuntimeState {
|
|
|
653
666
|
interface ScanService {
|
|
654
667
|
appEntry?: AppEntry;
|
|
655
668
|
pluginJson?: Plugin;
|
|
669
|
+
pluginJsonPath?: string;
|
|
656
670
|
subPackageMap: Map<string, SubPackageMetaValue>;
|
|
657
671
|
independentSubPackageMap: Map<string, SubPackageMetaValue>;
|
|
658
672
|
loadAppEntry: () => Promise<AppEntry>;
|
package/dist/config.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { UserConfig, UserConfigExport, UserConfigFnObject } from 'vite';
|
|
2
|
-
export { W as WeappViteConfig, a as defineAppJson, c as defineComponentJson, d as defineConfig, b as definePageJson, e as defineSitemapJson, f as defineThemeJson } from './config-
|
|
2
|
+
export { W as WeappViteConfig, a as defineAppJson, c as defineComponentJson, d as defineConfig, b as definePageJson, e as defineSitemapJson, f as defineThemeJson } from './config-Qcwf5OzO.cjs';
|
|
3
3
|
export { App, Component, Page, Sitemap, Theme } from '@weapp-core/schematics';
|
|
4
4
|
import 'rolldown';
|
|
5
5
|
import './routes-C9hKJjXs.cjs';
|
package/dist/config.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { UserConfig, UserConfigExport, UserConfigFnObject } from 'vite';
|
|
2
|
-
export { W as WeappViteConfig, a as defineAppJson, c as defineComponentJson, d as defineConfig, b as definePageJson, e as defineSitemapJson, f as defineThemeJson } from './config-
|
|
2
|
+
export { W as WeappViteConfig, a as defineAppJson, c as defineComponentJson, d as defineConfig, b as definePageJson, e as defineSitemapJson, f as defineThemeJson } from './config-CUFqPmXh.js';
|
|
3
3
|
export { App, Component, Page, Sitemap, Theme } from '@weapp-core/schematics';
|
|
4
4
|
import 'rolldown';
|
|
5
5
|
import './routes-C9hKJjXs.js';
|
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 _chunkXMPAHTORcjs = require('./chunk-XMPAHTOR.cjs');
|
|
4
|
+
require('./chunk-PONRZBHY.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
var _chunkDVVMF6NDcjs = require('./chunk-DVVMF6ND.cjs');
|
|
@@ -27,4 +27,4 @@ _chunkOS76JPG2cjs.init_cjs_shims.call(void 0, );
|
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
|
|
30
|
-
exports.createCompilerContext =
|
|
30
|
+
exports.createCompilerContext = _chunkXMPAHTORcjs.createCompilerContext; exports.defineAppJson = _chunkBT7FLFCCcjs.defineAppJson; exports.defineComponentJson = _chunkBT7FLFCCcjs.defineComponentJson; exports.defineConfig = _chunkDVVMF6NDcjs.defineConfig; exports.definePageJson = _chunkBT7FLFCCcjs.definePageJson; exports.defineSitemapJson = _chunkBT7FLFCCcjs.defineSitemapJson; exports.defineThemeJson = _chunkBT7FLFCCcjs.defineThemeJson;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { L as LoadConfigOptions, C as CompilerContext } from './config-
|
|
2
|
-
export { W as WeappViteConfig, a as defineAppJson, c as defineComponentJson, d as defineConfig, b as definePageJson, e as defineSitemapJson, f as defineThemeJson } from './config-
|
|
1
|
+
import { L as LoadConfigOptions, C as CompilerContext } from './config-Qcwf5OzO.cjs';
|
|
2
|
+
export { W as WeappViteConfig, a as defineAppJson, c as defineComponentJson, d as defineConfig, b as definePageJson, e as defineSitemapJson, f as defineThemeJson } from './config-Qcwf5OzO.cjs';
|
|
3
3
|
export { RolldownBuild, RolldownOptions, RolldownOutput, RolldownPlugin, RolldownPluginOption, WatchOptions as RolldownWatchOptions, RolldownWatcher } from 'rolldown';
|
|
4
4
|
export { ConfigEnv, InlineConfig, Plugin, PluginOption, ResolvedConfig, UserConfig, UserConfigExport, UserConfigFnObject, ViteDevServer } from 'vite';
|
|
5
5
|
export { App, Component, Page, Sitemap, Theme } from '@weapp-core/schematics';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { L as LoadConfigOptions, C as CompilerContext } from './config-
|
|
2
|
-
export { W as WeappViteConfig, a as defineAppJson, c as defineComponentJson, d as defineConfig, b as definePageJson, e as defineSitemapJson, f as defineThemeJson } from './config-
|
|
1
|
+
import { L as LoadConfigOptions, C as CompilerContext } from './config-CUFqPmXh.js';
|
|
2
|
+
export { W as WeappViteConfig, a as defineAppJson, c as defineComponentJson, d as defineConfig, b as definePageJson, e as defineSitemapJson, f as defineThemeJson } from './config-CUFqPmXh.js';
|
|
3
3
|
export { RolldownBuild, RolldownOptions, RolldownOutput, RolldownPlugin, RolldownPluginOption, WatchOptions as RolldownWatchOptions, RolldownWatcher } from 'rolldown';
|
|
4
4
|
export { ConfigEnv, InlineConfig, Plugin, PluginOption, ResolvedConfig, UserConfig, UserConfigExport, UserConfigFnObject, ViteDevServer } from 'vite';
|
|
5
5
|
export { App, Component, Page, Sitemap, Theme } from '@weapp-core/schematics';
|
package/dist/index.mjs
CHANGED
package/dist/json.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { App, Component, Page, Sitemap, Theme } from '@weapp-core/schematics';
|
|
2
|
-
export { a as defineAppJson, c as defineComponentJson, b as definePageJson, e as defineSitemapJson, f as defineThemeJson } from './config-
|
|
2
|
+
export { a as defineAppJson, c as defineComponentJson, b as definePageJson, e as defineSitemapJson, f as defineThemeJson } from './config-Qcwf5OzO.cjs';
|
|
3
3
|
import 'rolldown';
|
|
4
4
|
import 'vite';
|
|
5
5
|
import './routes-C9hKJjXs.cjs';
|
package/dist/json.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { App, Component, Page, Sitemap, Theme } from '@weapp-core/schematics';
|
|
2
|
-
export { a as defineAppJson, c as defineComponentJson, b as definePageJson, e as defineSitemapJson, f as defineThemeJson } from './config-
|
|
2
|
+
export { a as defineAppJson, c as defineComponentJson, b as definePageJson, e as defineSitemapJson, f as defineThemeJson } from './config-CUFqPmXh.js';
|
|
3
3
|
import 'rolldown';
|
|
4
4
|
import 'vite';
|
|
5
5
|
import './routes-C9hKJjXs.js';
|
package/dist/types.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { A as Alias, g as AliasOptions, T as AppEntry, w as AutoImportComponents, O as BaseEntry, B as BuildNpmPackageMeta, _ as ChangeEvent, D as ChunksConfig, X as ComponentEntry, N as ComponentsMap, u as CopyGlobs, t as CopyOptions, y as EnhanceOptions, E as EnhanceWxmlOptions, Q as Entry, Y as EntryJsonFragment, h as GenerateDirsOptions, G as GenerateExtensionsOptions, j as GenerateFileType, i as GenerateFilenamesOptions, s as GenerateOptions, o as GenerateTemplate, k as GenerateTemplateContext, p as GenerateTemplateEntry, n as GenerateTemplateFactory, l as GenerateTemplateFileSource, m as GenerateTemplateInlineSource, q as GenerateTemplateScope, r as GenerateTemplatesConfig, H as HandleWxmlOptions, J as JsFormat, M as MpPlatform, V as PageEntry, P as ProjectConfig, R as ResolvedAlias, K as ScanComponentItem, x as ScanWxmlOptions, z as SharedChunkStrategy, S as SubPackage, F as SubPackageMetaValue, U as UserConfig, W as WeappViteConfig, Z as WeappVitePluginApi, v as WeappWebConfig, I as WxmlDep } from './config-
|
|
1
|
+
export { A as Alias, g as AliasOptions, T as AppEntry, w as AutoImportComponents, O as BaseEntry, B as BuildNpmPackageMeta, _ as ChangeEvent, D as ChunksConfig, X as ComponentEntry, N as ComponentsMap, u as CopyGlobs, t as CopyOptions, y as EnhanceOptions, E as EnhanceWxmlOptions, Q as Entry, Y as EntryJsonFragment, h as GenerateDirsOptions, G as GenerateExtensionsOptions, j as GenerateFileType, i as GenerateFilenamesOptions, s as GenerateOptions, o as GenerateTemplate, k as GenerateTemplateContext, p as GenerateTemplateEntry, n as GenerateTemplateFactory, l as GenerateTemplateFileSource, m as GenerateTemplateInlineSource, q as GenerateTemplateScope, r as GenerateTemplatesConfig, H as HandleWxmlOptions, J as JsFormat, M as MpPlatform, V as PageEntry, P as ProjectConfig, R as ResolvedAlias, K as ScanComponentItem, x as ScanWxmlOptions, z as SharedChunkStrategy, S as SubPackage, F as SubPackageMetaValue, U as UserConfig, W as WeappViteConfig, Z as WeappVitePluginApi, v as WeappWebConfig, I as WxmlDep } from './config-Qcwf5OzO.cjs';
|
|
2
2
|
export { RolldownBuild, RolldownOptions, RolldownOutput, RolldownPlugin, RolldownPluginOption, WatchOptions as RolldownWatchOptions, RolldownWatcher } from 'rolldown';
|
|
3
3
|
export { ConfigEnv, InlineConfig, Plugin, PluginOption, ResolvedConfig, ViteDevServer } from 'vite';
|
|
4
4
|
export { A as AutoRoutes, a as AutoRoutesSubPackage } from './routes-C9hKJjXs.cjs';
|
package/dist/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { A as Alias, g as AliasOptions, T as AppEntry, w as AutoImportComponents, O as BaseEntry, B as BuildNpmPackageMeta, _ as ChangeEvent, D as ChunksConfig, X as ComponentEntry, N as ComponentsMap, u as CopyGlobs, t as CopyOptions, y as EnhanceOptions, E as EnhanceWxmlOptions, Q as Entry, Y as EntryJsonFragment, h as GenerateDirsOptions, G as GenerateExtensionsOptions, j as GenerateFileType, i as GenerateFilenamesOptions, s as GenerateOptions, o as GenerateTemplate, k as GenerateTemplateContext, p as GenerateTemplateEntry, n as GenerateTemplateFactory, l as GenerateTemplateFileSource, m as GenerateTemplateInlineSource, q as GenerateTemplateScope, r as GenerateTemplatesConfig, H as HandleWxmlOptions, J as JsFormat, M as MpPlatform, V as PageEntry, P as ProjectConfig, R as ResolvedAlias, K as ScanComponentItem, x as ScanWxmlOptions, z as SharedChunkStrategy, S as SubPackage, F as SubPackageMetaValue, U as UserConfig, W as WeappViteConfig, Z as WeappVitePluginApi, v as WeappWebConfig, I as WxmlDep } from './config-
|
|
1
|
+
export { A as Alias, g as AliasOptions, T as AppEntry, w as AutoImportComponents, O as BaseEntry, B as BuildNpmPackageMeta, _ as ChangeEvent, D as ChunksConfig, X as ComponentEntry, N as ComponentsMap, u as CopyGlobs, t as CopyOptions, y as EnhanceOptions, E as EnhanceWxmlOptions, Q as Entry, Y as EntryJsonFragment, h as GenerateDirsOptions, G as GenerateExtensionsOptions, j as GenerateFileType, i as GenerateFilenamesOptions, s as GenerateOptions, o as GenerateTemplate, k as GenerateTemplateContext, p as GenerateTemplateEntry, n as GenerateTemplateFactory, l as GenerateTemplateFileSource, m as GenerateTemplateInlineSource, q as GenerateTemplateScope, r as GenerateTemplatesConfig, H as HandleWxmlOptions, J as JsFormat, M as MpPlatform, V as PageEntry, P as ProjectConfig, R as ResolvedAlias, K as ScanComponentItem, x as ScanWxmlOptions, z as SharedChunkStrategy, S as SubPackage, F as SubPackageMetaValue, U as UserConfig, W as WeappViteConfig, Z as WeappVitePluginApi, v as WeappWebConfig, I as WxmlDep } from './config-CUFqPmXh.js';
|
|
2
2
|
export { RolldownBuild, RolldownOptions, RolldownOutput, RolldownPlugin, RolldownPluginOption, WatchOptions as RolldownWatchOptions, RolldownWatcher } from 'rolldown';
|
|
3
3
|
export { ConfigEnv, InlineConfig, Plugin, PluginOption, ResolvedConfig, ViteDevServer } from 'vite';
|
|
4
4
|
export { A as AutoRoutes, a as AutoRoutesSubPackage } from './routes-C9hKJjXs.js';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "weapp-vite",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "5.5.
|
|
4
|
+
"version": "5.5.1",
|
|
5
5
|
"description": "weapp-vite 一个现代化的小程序打包工具",
|
|
6
6
|
"author": "ice breaker <1324318532@qq.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -102,13 +102,13 @@
|
|
|
102
102
|
"tsdown": "^0.15.9",
|
|
103
103
|
"vite": "npm:rolldown-vite@^7.1.19",
|
|
104
104
|
"vite-tsconfig-paths": "^5.1.4",
|
|
105
|
-
"@weapp-core/init": "3.0.1",
|
|
106
105
|
"@weapp-core/logger": "2.0.0",
|
|
106
|
+
"@weapp-core/init": "3.0.1",
|
|
107
107
|
"@weapp-core/schematics": "4.0.0",
|
|
108
|
-
"@weapp-vite/volar": "0.0.1",
|
|
109
108
|
"@weapp-core/shared": "2.0.1",
|
|
110
|
-
"
|
|
109
|
+
"@weapp-vite/volar": "0.0.1",
|
|
111
110
|
"@weapp-vite/web": "0.0.2",
|
|
111
|
+
"rolldown-require": "1.0.4",
|
|
112
112
|
"vite-plugin-performance": "1.0.0",
|
|
113
113
|
"weapp-ide-cli": "4.0.0"
|
|
114
114
|
},
|