@contrast/agent-swc-plugin

1.5.0 • Public • Published

@contrast/agent-swc-plugin

Config

[
  "@contrast/agent-swc-plugin",
  {
    "assess": true, // default: false
    "inject": true // default: false
  }
]

assess

When true, enables all transforms. When false, only eval call expressions are rewritten, as these are the only transforms required by Protect.

inject

When true, prepends the script or module with ContrastMethods injections, i.e.

const foo = 'bar';

becomes:

var Function = global.ContrastMethods?.Function ?? Function;
var Number = global.ContrastMethods?.Number ?? Number;
var Object = global.ContrastMethods?.Object ?? Object;
var String = global.ContrastMethods?.String ?? String;
const foo = 'bar';

Readme

Keywords

Package Sidebar

Install

npm i @contrast/agent-swc-plugin

Weekly Downloads

18,921

Version

1.5.0

License

SEE LICENSE IN LICENSE

Unpacked Size

771 kB

Total Files

3

Last publish

Collaborators

  • planetlevel
  • contrastsec
  • tough-griff
  • annettenugent
  • michaelwitz
  • chrisdunne
  • contrast_admin
  • jcolekaplan
  • bmacnaughton