Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Obfuscate misses out some modules to obfuscate #150

Open
VijayaSankarN opened this issue Jul 29, 2024 · 2 comments
Open

Obfuscate misses out some modules to obfuscate #150

VijayaSankarN opened this issue Jul 29, 2024 · 2 comments

Comments

@VijayaSankarN
Copy link

I have to obfuscate 7173 modules (application in ReactJS CoreUI framework). With this configuration:

plugins: [
  react(),
  obfuscator({
    compact: false,
    numbersToExpressions: true,
    identifierNamesGenerator: 'hexadecimal',
    selfDefending: true,
    renameGlobals: true,
  }),
]

All modueles are processed. But any other options added to the above config, like deadCodeInjection or splitStrings or stringArray or any other options from https://www.npmjs.com/package/javascript-obfuscator, the number of modules being processed are getting reduced to anything less than 6000 randomly and then build ends without any errors. This prevents the execution of the application overall.

What is being missed or is there anything that I need to configure in vite or obfuscator configuration to always ensure that 7173 modules are being executed.

I even tried adding space size:

{
  "scripts": {
    "build": "cross-env NODE_OPTIONS='--max_old_space_size=8192' vite build"
  }
}

Adding this further affects the number of modules being processed to anywhere between 2000 and 3000. Adjusting the values are of no help.

Without this Obfuscate configuration vite build always builds all the modules successfully.

@Iceberry-qdd
Copy link

Same question.

After using this plugin:

vite v3.2.10 building for production...
✓ 201 modules transformed.

Not using this plugin:

vite v3.2.10 building for production...
✓ 326 modules transformed.

@Iceberry-qdd
Copy link

Oh, finally i solve this by change option ignoreImports from false to true. Guess you can add this option to solve it too.

plugins: [
  react(),
  obfuscator({
    compact: false,
    numbersToExpressions: true,
    identifierNamesGenerator: 'hexadecimal',
    selfDefending: true,
    renameGlobals: true,
    ignoreImports: true // Add this
  }),
]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants