Skip to content

Conversation

@egnor
Copy link

@egnor egnor commented Nov 19, 2025

  • In output-file obfuscation mode, this plugin wouldn't play well with other plugins that work with output files. Improve this by using the logic recommended in onEnd cannot be used to modify file output evanw/esbuild#2999 to capture and honor the initial .write setting, and modify output.content.
  • If output files were in subdirectories that did not initially exist, the plugin would crash attempting to write them (whereas esbuild will create parent directories as needed). Fix by also creating parent directories when writing files.
  • Support (in fact, require) .filter in output-file obfuscation mode. Otherwise every single output file gets processed, whether or not it's actually Javascript. (Perhaps the default should be ``["/**/*.{js,jsm,cjs}"]` for that mode?)
  • Add a .debug option that activates some debug logging to see what the plugin is doing.

@MatteoGheza
Copy link
Owner

Thanks for your contibution, and sorry for the delay, I had some problems with GH notifications

@egnor
Copy link
Author

egnor commented Dec 7, 2025

No worries, let me know what you think! The requirement to add a filter property is probably the most controversial thing here and would be a breaking change. It is consistent with other plugins, though.

Also whatever we settle on, I can update the README to describe.

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

Successfully merging this pull request may close these issues.

2 participants