@utoo/pack 1.3.4 → 1.3.6
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/cjs/core/hmr.js +4 -3
- package/config_schema.json +90 -0
- package/esm/core/hmr.js +4 -3
- package/package.json +9 -9
package/cjs/core/hmr.js
CHANGED
|
@@ -24,7 +24,7 @@ var pack_shared_2 = require("@utoo/pack-shared");
|
|
|
24
24
|
Object.defineProperty(exports, "HMR_ACTIONS_SENT_TO_BROWSER", { enumerable: true, get: function () { return pack_shared_2.HMR_ACTIONS_SENT_TO_BROWSER; } });
|
|
25
25
|
exports.FAST_REFRESH_RUNTIME_RELOAD = "Fast Refresh had to perform a full reload due to a runtime error.";
|
|
26
26
|
async function createHotReloader(bundleOptions, projectPath, rootPath) {
|
|
27
|
-
var _a, _b, _c, _d;
|
|
27
|
+
var _a, _b, _c, _d, _e, _f;
|
|
28
28
|
const resolvedProjectPath = projectPath || process.cwd();
|
|
29
29
|
(0, htmlEntry_1.processHtmlEntry)(bundleOptions.config, resolvedProjectPath);
|
|
30
30
|
(0, validateEntry_1.validateEntryPaths)(bundleOptions.config, resolvedProjectPath);
|
|
@@ -47,13 +47,14 @@ async function createHotReloader(bundleOptions, projectPath, rootPath) {
|
|
|
47
47
|
minify: false,
|
|
48
48
|
moduleIds: "named",
|
|
49
49
|
},
|
|
50
|
-
|
|
50
|
+
persistentCaching: (_c = (_b = bundleOptions === null || bundleOptions === void 0 ? void 0 : bundleOptions.config) === null || _b === void 0 ? void 0 : _b.persistentCaching) !== null && _c !== void 0 ? _c : true,
|
|
51
|
+
pluginRuntimeStrategy: (_e = (_d = bundleOptions === null || bundleOptions === void 0 ? void 0 : bundleOptions.config) === null || _d === void 0 ? void 0 : _d.pluginRuntimeStrategy) !== null && _e !== void 0 ? _e : ((0, runtimePluginStratety_1.useWorkerThreads)() ? "workerThreads" : "childProcesses"),
|
|
51
52
|
},
|
|
52
53
|
projectPath: (0, normalize_path_1.normalizePath)(resolvedProjectPath),
|
|
53
54
|
rootPath: rootPath || projectPath || process.cwd(),
|
|
54
55
|
packPath: (0, common_1.getPackPath)(),
|
|
55
56
|
}, {
|
|
56
|
-
persistentCaching: (
|
|
57
|
+
persistentCaching: (_f = bundleOptions.config.persistentCaching) !== null && _f !== void 0 ? _f : false,
|
|
57
58
|
});
|
|
58
59
|
const entrypointsSubscription = project.entrypointsSubscribe();
|
|
59
60
|
let currentEntriesHandlingResolve;
|
package/config_schema.json
CHANGED
|
@@ -192,6 +192,55 @@
|
|
|
192
192
|
}
|
|
193
193
|
},
|
|
194
194
|
"definitions": {
|
|
195
|
+
"SchemaCompressConfig": {
|
|
196
|
+
"description": "Compress configuration (boolean or options object)",
|
|
197
|
+
"anyOf": [
|
|
198
|
+
{
|
|
199
|
+
"type": "boolean"
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
"$ref": "#/definitions/SchemaCompressOptions"
|
|
203
|
+
}
|
|
204
|
+
]
|
|
205
|
+
},
|
|
206
|
+
"SchemaCompressOptions": {
|
|
207
|
+
"description": "Compress options for minification",
|
|
208
|
+
"type": "object",
|
|
209
|
+
"properties": {
|
|
210
|
+
"keepClassnames": {
|
|
211
|
+
"description": "Keep class names during compression",
|
|
212
|
+
"type": [
|
|
213
|
+
"boolean",
|
|
214
|
+
"null"
|
|
215
|
+
]
|
|
216
|
+
},
|
|
217
|
+
"keepFnames": {
|
|
218
|
+
"description": "Keep function names during compression",
|
|
219
|
+
"type": [
|
|
220
|
+
"boolean",
|
|
221
|
+
"null"
|
|
222
|
+
]
|
|
223
|
+
},
|
|
224
|
+
"passes": {
|
|
225
|
+
"description": "Number of compress passes",
|
|
226
|
+
"type": [
|
|
227
|
+
"integer",
|
|
228
|
+
"null"
|
|
229
|
+
],
|
|
230
|
+
"format": "uint8",
|
|
231
|
+
"minimum": 0.0
|
|
232
|
+
},
|
|
233
|
+
"sequences": {
|
|
234
|
+
"description": "Sequence optimization level",
|
|
235
|
+
"type": [
|
|
236
|
+
"integer",
|
|
237
|
+
"null"
|
|
238
|
+
],
|
|
239
|
+
"format": "uint8",
|
|
240
|
+
"minimum": 0.0
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
},
|
|
195
244
|
"SchemaConfigConditionContentType": {
|
|
196
245
|
"description": "Configuration condition for content type",
|
|
197
246
|
"oneOf": [
|
|
@@ -451,6 +500,25 @@
|
|
|
451
500
|
}
|
|
452
501
|
]
|
|
453
502
|
},
|
|
503
|
+
"SchemaCrossOriginLoading": {
|
|
504
|
+
"description": "Webpack-compatible `output.crossOriginLoading`. Supports `false`, `\"anonymous\"`, and `\"use-credentials\"`.",
|
|
505
|
+
"anyOf": [
|
|
506
|
+
{
|
|
507
|
+
"type": "boolean"
|
|
508
|
+
},
|
|
509
|
+
{
|
|
510
|
+
"$ref": "#/definitions/SchemaCrossOriginLoadingMode"
|
|
511
|
+
}
|
|
512
|
+
]
|
|
513
|
+
},
|
|
514
|
+
"SchemaCrossOriginLoadingMode": {
|
|
515
|
+
"description": "Cross-origin loading mode for dynamic chunks.",
|
|
516
|
+
"type": "string",
|
|
517
|
+
"enum": [
|
|
518
|
+
"anonymous",
|
|
519
|
+
"use-credentials"
|
|
520
|
+
]
|
|
521
|
+
},
|
|
454
522
|
"SchemaDevServer": {
|
|
455
523
|
"description": "Development server configuration",
|
|
456
524
|
"type": "object",
|
|
@@ -910,6 +978,17 @@
|
|
|
910
978
|
"description": "Optimization configuration",
|
|
911
979
|
"type": "object",
|
|
912
980
|
"properties": {
|
|
981
|
+
"compress": {
|
|
982
|
+
"description": "Whether to enable compression when minifying",
|
|
983
|
+
"anyOf": [
|
|
984
|
+
{
|
|
985
|
+
"$ref": "#/definitions/SchemaCompressConfig"
|
|
986
|
+
},
|
|
987
|
+
{
|
|
988
|
+
"type": "null"
|
|
989
|
+
}
|
|
990
|
+
]
|
|
991
|
+
},
|
|
913
992
|
"concatenateModules": {
|
|
914
993
|
"description": "Whether to concatenate modules when possible to reduce the number of chunks. This can improve performance by reducing the number of requests and improving caching.",
|
|
915
994
|
"type": [
|
|
@@ -1072,6 +1151,17 @@
|
|
|
1072
1151
|
"$ref": "#/definitions/SchemaCopyItem"
|
|
1073
1152
|
}
|
|
1074
1153
|
},
|
|
1154
|
+
"crossOriginLoading": {
|
|
1155
|
+
"description": "Controls crossorigin for dynamically loaded chunks. Supports false, 'anonymous', or 'use-credentials'.",
|
|
1156
|
+
"anyOf": [
|
|
1157
|
+
{
|
|
1158
|
+
"$ref": "#/definitions/SchemaCrossOriginLoading"
|
|
1159
|
+
},
|
|
1160
|
+
{
|
|
1161
|
+
"type": "null"
|
|
1162
|
+
}
|
|
1163
|
+
]
|
|
1164
|
+
},
|
|
1075
1165
|
"cssChunkFilename": {
|
|
1076
1166
|
"description": "Filename pattern for CSS chunk files",
|
|
1077
1167
|
"type": [
|
package/esm/core/hmr.js
CHANGED
|
@@ -16,7 +16,7 @@ const sessionId = Math.floor(Number.MAX_SAFE_INTEGER * Math.random());
|
|
|
16
16
|
export { HMR_ACTIONS_SENT_TO_BROWSER, } from "@utoo/pack-shared";
|
|
17
17
|
export const FAST_REFRESH_RUNTIME_RELOAD = "Fast Refresh had to perform a full reload due to a runtime error.";
|
|
18
18
|
export async function createHotReloader(bundleOptions, projectPath, rootPath) {
|
|
19
|
-
var _a, _b, _c, _d;
|
|
19
|
+
var _a, _b, _c, _d, _e, _f;
|
|
20
20
|
const resolvedProjectPath = projectPath || process.cwd();
|
|
21
21
|
processHtmlEntry(bundleOptions.config, resolvedProjectPath);
|
|
22
22
|
validateEntryPaths(bundleOptions.config, resolvedProjectPath);
|
|
@@ -39,13 +39,14 @@ export async function createHotReloader(bundleOptions, projectPath, rootPath) {
|
|
|
39
39
|
minify: false,
|
|
40
40
|
moduleIds: "named",
|
|
41
41
|
},
|
|
42
|
-
|
|
42
|
+
persistentCaching: (_c = (_b = bundleOptions === null || bundleOptions === void 0 ? void 0 : bundleOptions.config) === null || _b === void 0 ? void 0 : _b.persistentCaching) !== null && _c !== void 0 ? _c : true,
|
|
43
|
+
pluginRuntimeStrategy: (_e = (_d = bundleOptions === null || bundleOptions === void 0 ? void 0 : bundleOptions.config) === null || _d === void 0 ? void 0 : _d.pluginRuntimeStrategy) !== null && _e !== void 0 ? _e : (useWorkerThreads() ? "workerThreads" : "childProcesses"),
|
|
43
44
|
},
|
|
44
45
|
projectPath: normalizePath(resolvedProjectPath),
|
|
45
46
|
rootPath: rootPath || projectPath || process.cwd(),
|
|
46
47
|
packPath: getPackPath(),
|
|
47
48
|
}, {
|
|
48
|
-
persistentCaching: (
|
|
49
|
+
persistentCaching: (_f = bundleOptions.config.persistentCaching) !== null && _f !== void 0 ? _f : false,
|
|
49
50
|
});
|
|
50
51
|
const entrypointsSubscription = project.entrypointsSubscribe();
|
|
51
52
|
let currentEntriesHandlingResolve;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@utoo/pack",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.6",
|
|
4
4
|
"main": "cjs/index.js",
|
|
5
5
|
"module": "esm/index.js",
|
|
6
6
|
"types": "esm/index.d.ts",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"@hono/node-server": "^1.19.11",
|
|
42
42
|
"@hono/node-ws": "^1.3.0",
|
|
43
43
|
"@swc/helpers": "0.5.15",
|
|
44
|
-
"@utoo/pack-shared": "1.3.
|
|
44
|
+
"@utoo/pack-shared": "1.3.6",
|
|
45
45
|
"domparser-rs": "^0.0.7",
|
|
46
46
|
"find-up": "4.1.0",
|
|
47
47
|
"get-port": "^7.1.0",
|
|
@@ -92,12 +92,12 @@
|
|
|
92
92
|
},
|
|
93
93
|
"repository": "git@github.com:utooland/utoo.git",
|
|
94
94
|
"optionalDependencies": {
|
|
95
|
-
"@utoo/pack-darwin-arm64": "1.3.
|
|
96
|
-
"@utoo/pack-darwin-x64": "1.3.
|
|
97
|
-
"@utoo/pack-linux-arm64-gnu": "1.3.
|
|
98
|
-
"@utoo/pack-linux-arm64-musl": "1.3.
|
|
99
|
-
"@utoo/pack-linux-x64-gnu": "1.3.
|
|
100
|
-
"@utoo/pack-linux-x64-musl": "1.3.
|
|
101
|
-
"@utoo/pack-win32-x64-msvc": "1.3.
|
|
95
|
+
"@utoo/pack-darwin-arm64": "1.3.6",
|
|
96
|
+
"@utoo/pack-darwin-x64": "1.3.6",
|
|
97
|
+
"@utoo/pack-linux-arm64-gnu": "1.3.6",
|
|
98
|
+
"@utoo/pack-linux-arm64-musl": "1.3.6",
|
|
99
|
+
"@utoo/pack-linux-x64-gnu": "1.3.6",
|
|
100
|
+
"@utoo/pack-linux-x64-musl": "1.3.6",
|
|
101
|
+
"@utoo/pack-win32-x64-msvc": "1.3.6"
|
|
102
102
|
}
|
|
103
103
|
}
|