ghostdevv / rollup-obfuscator

A plugin to obfuscate javascript for rollup based on https://www.npmjs.com/javascript-obfuscator
MIT License
56 stars 7 forks source link

Argument of type error #114

Closed CRC32EX closed 2 years ago

CRC32EX commented 2 years ago

Steps to reproduce this issue

  1. Init Vue3 project

    npm init vue@latest

    image

  2. Install modules

    cd vue-project
    npm install
    npm install -D rollup-obfuscator javascript-obfuscator
  3. Edit vite.config.ts

image

  1. Error
    Argument of type '{ stringArray: true; stringArrayEncoding: \"rc4\"[]; }'
    is not assignable to parameter of type 'ObfuscatorPluginOptions'.
    Property 'global' is missing in type '{ stringArray: true; stringArrayEncoding: \"rc4\"[]; }'
    but required in type 'ObfuscatorPluginOptions'.",

image

Environment

ghostdevv commented 2 years ago

Can you try in version 3.0.1, the global option isn't defaulting correctly. As a workaround for version 3.0.0 you can just set global to true to make the type error go away

CRC32EX commented 2 years ago

3.0.1 works successfully. Thank you.

ghostdevv commented 2 years ago

Np