@contrast/rewriter 1.38.0 → 1.39.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/lib/index.js +3 -2
- package/package.json +5 -5
package/lib/index.js
CHANGED
|
@@ -72,6 +72,7 @@ class Rewriter {
|
|
|
72
72
|
const nodeCfg = this.core.config.agent.node;
|
|
73
73
|
const sourceMaps = nodeCfg.source_maps.enable;
|
|
74
74
|
const minify = opts.minify && nodeCfg.source_maps.enable && nodeCfg.rewrite.minify;
|
|
75
|
+
opts.minify = minify;
|
|
75
76
|
return {
|
|
76
77
|
swcrc: false,
|
|
77
78
|
filename: opts.filename,
|
|
@@ -150,8 +151,8 @@ class Rewriter {
|
|
|
150
151
|
* @returns {Promise<import('@swc/core').Output>} with possibly modified source map.
|
|
151
152
|
*/
|
|
152
153
|
async rewrite(content, opts = {}) {
|
|
153
|
-
this.logger.trace({ opts }, 'rewriting %s', opts.filename);
|
|
154
154
|
const rewriteOpts = this.swcOptions(opts);
|
|
155
|
+
this.logger.trace({ opts }, 'rewriting %s', opts.filename);
|
|
155
156
|
const ret = await transform(content, rewriteOpts);
|
|
156
157
|
this.adjustMap(rewriteOpts, ret);
|
|
157
158
|
return ret;
|
|
@@ -167,8 +168,8 @@ class Rewriter {
|
|
|
167
168
|
* @returns {import('@swc/core').Output} with possibly modified source map.
|
|
168
169
|
*/
|
|
169
170
|
rewriteSync(content, opts = {}) {
|
|
170
|
-
this.logger.trace({ opts }, 'rewriting %s', opts.filename);
|
|
171
171
|
const rewriteOpts = this.swcOptions(opts);
|
|
172
|
+
this.logger.trace({ opts }, 'rewriting %s', opts.filename);
|
|
172
173
|
const result = transformSync(content, rewriteOpts);
|
|
173
174
|
this.adjustMap(rewriteOpts, result);
|
|
174
175
|
return result;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contrast/rewriter",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.39.1",
|
|
4
4
|
"description": "A transpilation tool mainly used for instrumentation",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"author": "Contrast Security <nodejs@contrastsecurity.com> (https://www.contrastsecurity.com)",
|
|
@@ -21,11 +21,11 @@
|
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@contrast/agent-swc-plugin": "3.2.0",
|
|
24
|
-
"@contrast/common": "1.
|
|
25
|
-
"@contrast/config": "1.
|
|
26
|
-
"@contrast/core": "1.
|
|
24
|
+
"@contrast/common": "1.41.1",
|
|
25
|
+
"@contrast/config": "1.57.1",
|
|
26
|
+
"@contrast/core": "1.62.1",
|
|
27
27
|
"@contrast/fn-inspect": "^5.0.2",
|
|
28
|
-
"@contrast/logger": "1.
|
|
28
|
+
"@contrast/logger": "1.35.1",
|
|
29
29
|
"@contrast/synchronous-source-maps": "^1.1.5",
|
|
30
30
|
"@swc/core": "1.13.3"
|
|
31
31
|
}
|