Skip to content

"npm run build" produces a ~236 MB plugin zip instead of the expected ~8.4 MB #3506

Description

@ankitguptaindia

Describe the bug:

Running the production build (npm run build) generates the distributable plugin archive google-listings-and-ads.zip in the plugin root, but the resulting file is approximately 236 MB, whereas the expected size is approximately 8.4 MB.

For reference, the project's own bundlewatch configuration in package.json asserts the zip should be at most 8.43 mB:

{
  "path": "./google-listings-and-ads.zip",
  "maxSize": "8.43 mB",
  "compression": "none"
}

A 236 MB artifact is ~28x the expected size and is not suitable for distribution/upload.

Steps to reproduce:

  1. Clone the repository (develop branch).
  2. From the plugin root, run: npm i && composer i && npm run build
  3. Check the generated google-listings-and-ads.zip in the main plugin folder (created by the postbuild -> archive scripts).

Expected behavior:

The build produces google-listings-and-ads.zip at roughly 8.4 MB, containing only the runtime files needed to ship the plugin (e.g. src, js/build, production vendor, languages, views, main plugin PHP files), with development/build artifacts excluded.

Actual behavior:

The generated google-listings-and-ads.zip is approximately 236 MB. The archive appears to include files that should be excluded from the distributable package (development dependencies and/or build tooling artifacts such as node_modules, dev vendor packages, .git, tests, etc.).

Additional details:

  • Attached files via different source:

Plugin File from stable release:

Image

google-listings-and-ads.zip

Plugin File from npm run build release:

Image

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions