Skip to content

.min.js.map files not excluded in make-pot, causing .min.js to be parsed and leading to memory issues #449

@vipul0425

Description

@vipul0425

Bug Report

Describe the current, buggy behavior

The make-pot command attempts to parse .min.js files even though they are explicitly listed in the excluded patterns (*.min.js). This happens when the corresponding .min.js.map files are present in the same directory.

In --debug mode, the log misleadingly shows that .min.js files are being parsed. However, the actual culprit appears to be the .min.js.map files. This can cause unnecessary processing and even memory exhaustion issues in large codebases with many .min.js and .min.js.map files.

Describe how other contributors can replicate this bug

  • Create a build directory with a .min.js file and its corresponding .min.js.map file.
  • Run the wp i18n make-pot command on the directory with --debug enabled.
  • Observe the debug output showing .min.js being parsed despite being excluded.
  • In larger projects, this may lead to memory exhaustion or long processing times.

Describe what you would expect as the correct outcome

Ideally, .min.js.map files should also be excluded from parsing just like .min.js.
At the very least, the debug output should clearly state when .map files are being parsed, to aid troubleshooting.

Provide a possible solution

Update the exclusion list to also include *.min.js.map or .map.

Provide additional context/Screenshots

Image Image Image

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions