@contrast/rewriter 1.21.1 → 1.21.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.
Files changed (2) hide show
  1. package/lib/index.js +2 -0
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -16,6 +16,7 @@
16
16
  'use strict';
17
17
 
18
18
  const Module = require('node:module');
19
+ const path = require('node:path');
19
20
  const { transform, transformSync } = require('@swc/core');
20
21
  const { Cache } = require('./cache');
21
22
  const { primordials: { StringPrototypeReplace, StringPrototypeSubstring } } = require('@contrast/common');
@@ -111,6 +112,7 @@ class Rewriter {
111
112
  assess: this.modes.has('assess'),
112
113
  inject: opts.inject,
113
114
  }]],
115
+ cacheRoot: path.join(this.core.config.agent.node.rewrite.cache.path, '.swc'),
114
116
  },
115
117
  },
116
118
  sourceMaps: this.core.config.agent.node.source_maps.enable,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contrast/rewriter",
3
- "version": "1.21.1",
3
+ "version": "1.21.2",
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)",