Skip to content
This repository was archived by the owner on Jul 12, 2024. It is now read-only.
This repository was archived by the owner on Jul 12, 2024. It is now read-only.

The source of @woocommerce/settings processed by DEWP is confusing #7810

Closed
@tomalec

Description

@tomalec

Describe the bug

As a plugin developer, I tried to use Dependency Extraction Webpack Plugin to use a package to obtain the WooCommerce settings. (woocommerce/pinterest-for-woocommerce#224, woocommerce/google-listings-and-ads#1050)

I checked that wc.wcSettings delivers the data I need. So I checked the README of DEWP to check which plugin I should actually import in my local package.json, and which package I should inspect to check its API and behavior. README states:

Request Global Script handle
@woocommerce/settings wc['wcSettings'] wc-settings

But the thing is, it's not the @woocommerce/settings. It is wp-content/plugins/woocommerce/packages/woocommerce-blocks/build/wc-settings.js

Which AFAIK is not published anywhere, therefore, could not even be my plugins dependency.

To Reproduce

  1. Install and setup Woo DEWP on your plugin repo.
  2. Add import foo from @woocommerce/settings
  3. Install locally npm install --save @woocommerce/settings
  4. Run unit tests

Actual behavior:

The local @woocommerce/settings package is different than externalized.

Screenshots

Expected behavior

The README points to the exact package that would be externalized.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: documentationThis issue is a request for better documentation.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions