@pi-r/terser 0.5.0 → 0.6.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/README.md +2 -0
- package/index.js +3 -4
- package/package.json +3 -3
package/README.md
CHANGED
package/index.js
CHANGED
|
@@ -24,7 +24,6 @@ const MINIFY_PROPS = [
|
|
|
24
24
|
'wrap'
|
|
25
25
|
];
|
|
26
26
|
async function transform(context, value, options) {
|
|
27
|
-
var _a, _b;
|
|
28
27
|
context = options.upgrade(context, __dirname);
|
|
29
28
|
const { sourceMap, supplementChunks } = options;
|
|
30
29
|
const baseConfig = options.toBaseConfig();
|
|
@@ -45,7 +44,7 @@ async function transform(context, value, options) {
|
|
|
45
44
|
for (const chunk of supplementChunks) {
|
|
46
45
|
const chunkConfig = { ...baseConfig };
|
|
47
46
|
if (util.isObject(chunkConfig.sourceMap)) {
|
|
48
|
-
chunkConfig.sourceMap = { content:
|
|
47
|
+
chunkConfig.sourceMap = { content: chunk.sourceMap?.map, asObject: true };
|
|
49
48
|
}
|
|
50
49
|
const result = await context.minify(chunk.code, chunkConfig);
|
|
51
50
|
if (result) {
|
|
@@ -56,13 +55,13 @@ async function transform(context, value, options) {
|
|
|
56
55
|
(chunk.sourceMap || (chunk.sourceMap = options.createSourceMap(code))).nextMap('terser', code, map);
|
|
57
56
|
}
|
|
58
57
|
else {
|
|
59
|
-
|
|
58
|
+
chunk.sourceMap?.reset();
|
|
60
59
|
}
|
|
61
60
|
}
|
|
62
61
|
}
|
|
63
62
|
}
|
|
64
63
|
const result = await context.minify(value, util.removeInternalProperties(baseConfig, MINIFY_PROPS));
|
|
65
|
-
if (result
|
|
64
|
+
if (result?.code) {
|
|
66
65
|
if (result.map) {
|
|
67
66
|
sourceMap.nextMap('terser', result.code, result.map, url);
|
|
68
67
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pi-r/terser",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.2",
|
|
4
4
|
"description": "terser transform function for E-mc.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"publishConfig": {
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"license": "MIT",
|
|
21
21
|
"homepage": "https://github.com/anpham6/pi-r#readme",
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@e-mc/document": "^0.
|
|
24
|
-
"terser": "^5.
|
|
23
|
+
"@e-mc/document": "^0.8.2",
|
|
24
|
+
"terser": "^5.27.0"
|
|
25
25
|
}
|
|
26
26
|
}
|