@rushstack/module-minifier 0.4.40 → 0.5.0
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/tsdoc-metadata.json
CHANGED
package/lib/MinifierWorker.js
CHANGED
|
@@ -7,11 +7,17 @@ const MinifySingleFile_1 = require("./MinifySingleFile");
|
|
|
7
7
|
const terserOptions = worker_threads_1.workerData;
|
|
8
8
|
// Set to non-zero to help debug unexpected graceful exit
|
|
9
9
|
process.exitCode = 2;
|
|
10
|
-
|
|
10
|
+
async function handler(message) {
|
|
11
11
|
if (!message) {
|
|
12
|
-
|
|
12
|
+
worker_threads_1.parentPort.off('postMessage', handler);
|
|
13
|
+
worker_threads_1.parentPort.close();
|
|
14
|
+
return;
|
|
13
15
|
}
|
|
14
16
|
const result = await (0, MinifySingleFile_1.minifySingleFileAsync)(message, terserOptions);
|
|
15
17
|
worker_threads_1.parentPort.postMessage(result);
|
|
18
|
+
}
|
|
19
|
+
worker_threads_1.parentPort.once('close', () => {
|
|
20
|
+
process.exitCode = 0;
|
|
16
21
|
});
|
|
22
|
+
worker_threads_1.parentPort.on('message', handler);
|
|
17
23
|
//# sourceMappingURL=MinifierWorker.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MinifierWorker.js","sourceRoot":"","sources":["../src/MinifierWorker.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;AAG3D,mDAAwD;AAExD,yDAA2D;AAG3D,MAAM,aAAa,GAAkB,2BAAU,CAAC;AAEhD,yDAAyD;AACzD,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;AAErB,
|
|
1
|
+
{"version":3,"file":"MinifierWorker.js","sourceRoot":"","sources":["../src/MinifierWorker.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F,2DAA2D;;AAG3D,mDAAwD;AAExD,yDAA2D;AAG3D,MAAM,aAAa,GAAkB,2BAAU,CAAC;AAEhD,yDAAyD;AACzD,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;AAErB,KAAK,UAAU,OAAO,CAAC,OAAmC;IACxD,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,2BAAW,CAAC,GAAG,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;QACxC,2BAAW,CAAC,KAAK,EAAE,CAAC;QACpB,OAAO;IACT,CAAC;IAED,MAAM,MAAM,GAA8B,MAAM,IAAA,wCAAqB,EAAC,OAAO,EAAE,aAAa,CAAC,CAAC;IAE9F,2BAAW,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;AAClC,CAAC;AAED,2BAAW,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,EAAE;IAC7B,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;AACvB,CAAC,CAAC,CAAC;AACH,2BAAW,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport type { MinifyOptions } from 'terser';\nimport { parentPort, workerData } from 'worker_threads';\n\nimport { minifySingleFileAsync } from './MinifySingleFile';\nimport type { IModuleMinificationRequest, IModuleMinificationResult } from './types';\n\nconst terserOptions: MinifyOptions = workerData;\n\n// Set to non-zero to help debug unexpected graceful exit\nprocess.exitCode = 2;\n\nasync function handler(message: IModuleMinificationRequest): Promise<void> {\n if (!message) {\n parentPort!.off('postMessage', handler);\n parentPort!.close();\n return;\n }\n\n const result: IModuleMinificationResult = await minifySingleFileAsync(message, terserOptions);\n\n parentPort!.postMessage(result);\n}\n\nparentPort!.once('close', () => {\n process.exitCode = 0;\n});\nparentPort!.on('message', handler);\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rushstack/module-minifier",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "Wrapper for terser to support bulk parallel minification.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"typings": "dist/module-minifier.d.ts",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"serialize-javascript": "6.0.0",
|
|
15
15
|
"source-map": "~0.7.3",
|
|
16
16
|
"terser": "^5.9.0",
|
|
17
|
-
"@rushstack/worker-pool": "0.4.
|
|
17
|
+
"@rushstack/worker-pool": "0.4.40"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
20
|
"@types/serialize-javascript": "5.0.2",
|