Skip to content

source files overwritten #1359

@erjoalgo

Description

@erjoalgo

Expected Behavior

javascript-obfuscator ./resources/js --output ./resources/public/js should keep the original sources in resources/js unchaged and write the obfuscated files into ./resources/public/js

Current Behavior

If the output directory is not a subdirectory of the sources directory, the original sources are overwritten.

Steps to Reproduce

JavaScript Obfuscator Edition

  • JavaScript Obfuscator Open Source

Your Environment

  • Obfuscator version used:
  • Node version used:
$ npm --version
10.2.4

$ javascript-obfuscator --version
5.1.0_2025-12-13T15:46:00.693Z

Stack trace

Minimal working example that will help to reproduce issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions