@utoo/pack 1.3.4 → 1.3.5-alpha.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/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
- pluginRuntimeStrategy: (_c = (_b = bundleOptions === null || bundleOptions === void 0 ? void 0 : bundleOptions.config) === null || _b === void 0 ? void 0 : _b.pluginRuntimeStrategy) !== null && _c !== void 0 ? _c : ((0, runtimePluginStratety_1.useWorkerThreads)() ? "workerThreads" : "childProcesses"),
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: (_d = bundleOptions.config.persistentCaching) !== null && _d !== void 0 ? _d : false,
57
+ persistentCaching: (_f = bundleOptions.config.persistentCaching) !== null && _f !== void 0 ? _f : false,
57
58
  });
58
59
  const entrypointsSubscription = project.entrypointsSubscribe();
59
60
  let currentEntriesHandlingResolve;
@@ -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": [
@@ -910,6 +959,17 @@
910
959
  "description": "Optimization configuration",
911
960
  "type": "object",
912
961
  "properties": {
962
+ "compress": {
963
+ "description": "Whether to enable compression when minifying",
964
+ "anyOf": [
965
+ {
966
+ "$ref": "#/definitions/SchemaCompressConfig"
967
+ },
968
+ {
969
+ "type": "null"
970
+ }
971
+ ]
972
+ },
913
973
  "concatenateModules": {
914
974
  "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
975
  "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
- pluginRuntimeStrategy: (_c = (_b = bundleOptions === null || bundleOptions === void 0 ? void 0 : bundleOptions.config) === null || _b === void 0 ? void 0 : _b.pluginRuntimeStrategy) !== null && _c !== void 0 ? _c : (useWorkerThreads() ? "workerThreads" : "childProcesses"),
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: (_d = bundleOptions.config.persistentCaching) !== null && _d !== void 0 ? _d : false,
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.4",
3
+ "version": "1.3.5-alpha.3",
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.4",
44
+ "@utoo/pack-shared": "1.3.5-alpha.3",
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.4",
96
- "@utoo/pack-darwin-x64": "1.3.4",
97
- "@utoo/pack-linux-arm64-gnu": "1.3.4",
98
- "@utoo/pack-linux-arm64-musl": "1.3.4",
99
- "@utoo/pack-linux-x64-gnu": "1.3.4",
100
- "@utoo/pack-linux-x64-musl": "1.3.4",
101
- "@utoo/pack-win32-x64-msvc": "1.3.4"
95
+ "@utoo/pack-darwin-arm64": "1.3.5-alpha.3",
96
+ "@utoo/pack-darwin-x64": "1.3.5-alpha.3",
97
+ "@utoo/pack-linux-arm64-gnu": "1.3.5-alpha.3",
98
+ "@utoo/pack-linux-arm64-musl": "1.3.5-alpha.3",
99
+ "@utoo/pack-linux-x64-gnu": "1.3.5-alpha.3",
100
+ "@utoo/pack-linux-x64-musl": "1.3.5-alpha.3",
101
+ "@utoo/pack-win32-x64-msvc": "1.3.5-alpha.3"
102
102
  }
103
103
  }