Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Abstract away and document advanced constants used in webpack config #14492

Closed
gziolo opened this issue Mar 18, 2019 · 5 comments · Fixed by #22310
Closed

Abstract away and document advanced constants used in webpack config #14492

gziolo opened this issue Mar 18, 2019 · 5 comments · Fixed by #22310
Assignees
Labels
Good First Issue An issue that's suitable for someone looking to contribute for the first time [Status] In Progress Tracking issues with work in progress [Tool] WP Scripts /packages/scripts [Type] Build Tooling Issues or PRs related to build tooling [Type] Developer Documentation Documentation for developers

Comments

@gziolo
Copy link
Member

gziolo commented Mar 18, 2019

The documentation around webpack config has been documented in-depth as explained in #8982 (comment).

The last part left is how one can take advantage of global variables to do some advanced work:

  • WP_BUNDLE_ANALYZER
  • WP_DEVTOOL
  • WP_LIVE_RELOAD_PORT

Ideally, those constants should be abstracted with CLI arguments similar to @draganescu did in #14129. In effect, we would be able to run the following, e.g.:

$ npx wp-scripts build --webpack-live-reload-port=12345 --webpack-bundle-analyzer --webpack-devtool=inline-source-map

Example of the existing implementation of similar CLI args for npx wp-scripts test-e2e:
https://github.com/WordPress/gutenberg/blob/master/packages/scripts/scripts/test-e2e.js#L46-L65

@gziolo gziolo added [Type] Build Tooling Issues or PRs related to build tooling Good First Issue An issue that's suitable for someone looking to contribute for the first time labels Mar 18, 2019
@gziolo gziolo added the [Type] Developer Documentation Documentation for developers label Mar 18, 2019
@gziolo
Copy link
Member Author

gziolo commented Mar 18, 2019

By the way, it also reminds me that we forgot to document custom CLI args passed to wp-scripts e2e - it would be nice to include them as well. Filed as #14494.

@Jackie6
Copy link
Contributor

Jackie6 commented Mar 18, 2019

Hi @gziolo I have created a pull request to update the documentation of wp scripts.

@gziolo gziolo added [Status] In Progress Tracking issues with work in progress Needs Dev Ready for, and needs developer efforts and removed [Status] In Progress Tracking issues with work in progress labels Apr 10, 2019
@gziolo
Copy link
Member Author

gziolo commented Apr 12, 2019

This issue is waiting for volunteers again.

@oandregal oandregal added the [Tool] WP Scripts /packages/scripts label May 7, 2019
@gziolo
Copy link
Member Author

gziolo commented Mar 10, 2020

@gziolo
Copy link
Member Author

gziolo commented May 13, 2020

WP_LIVE_RELOAD_PORT won't be promoted to a CLI flag because its future is uncertain. It might get replaces with React Fast Refresh as proposed in #21008.

@gziolo gziolo added [Status] In Progress Tracking issues with work in progress and removed Needs Dev Ready for, and needs developer efforts labels May 13, 2020
@gziolo gziolo self-assigned this May 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Good First Issue An issue that's suitable for someone looking to contribute for the first time [Status] In Progress Tracking issues with work in progress [Tool] WP Scripts /packages/scripts [Type] Build Tooling Issues or PRs related to build tooling [Type] Developer Documentation Documentation for developers
Projects
None yet
3 participants