Switch the build process to @wordpress/scripts#1
Merged
Conversation
Replaces 10up-toolkit with @wordpress/scripts as the bundler. Adds a
custom webpack.config.js that layers two extension-specific tweaks on
top of the wp-scripts defaults:
- Dual entry points — the shipping popup bundle and the dev-only
preview bundle used by popup/preview.html.
- DependencyExtractionWebpackPlugin filtered out — wp-scripts assumes
@wordpress/* packages are available on the wp.* global at runtime
(true inside wp-admin, false in a browser extension), so we bundle
them into popup.js.
Output stays in dist/ so popup.html, sync-safari.sh, package-chrome.sh,
and the Safari Xcode project keep working without path changes. wp-
scripts emits a few unused auxiliary files (popup-rtl.css, source maps);
they're gitignored since the shipping zip and Safari Resources sync
don't include them.
Drops the now-unused 10up-toolkit config files
(buildfiles/filenames/paths.config.js) and the popup.js.LICENSE.txt
artifact (wp-scripts' Terser config strips license comments and doesn't
extract them to a sidecar file).
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
There was a problem hiding this comment.
Pull request overview
Switches the popup build pipeline from 10up-toolkit to @wordpress/scripts, keeping output paths compatible with the browser extension packaging and Safari sync flows.
Changes:
- Adds a custom
webpack.config.jswith popup/preview entry points and bundled WordPress dependencies. - Updates npm scripts/dependencies and removes old 10up-toolkit config files.
- Adjusts packaging/sync scripts and generated/ignored dist artifacts for wp-scripts output.
Reviewed changes
Copilot reviewed 7 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
webpack.config.js |
Adds wp-scripts-based webpack customization for extension output. |
package.json |
Replaces 10up-toolkit scripts/dependency with wp-scripts and adds browserslist. |
.gitignore |
Ignores wp-scripts auxiliary dist outputs. |
scripts/package-chrome.sh |
Stops copying the removed license sidecar into Chrome packages. |
scripts/sync-safari.sh |
Stops copying the removed license sidecar into Safari resources. |
buildfiles.config.js |
Removes obsolete 10up-toolkit entry config. |
filenames.config.js |
Removes obsolete 10up-toolkit filename config. |
paths.config.js |
Removes obsolete 10up-toolkit path config. |
dist/popup.css |
Updates generated popup stylesheet artifact. |
dist/popup.js.LICENSE.txt |
Removes old extracted license sidecar artifact. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The committed dist/popup.js was a 2.4 MB unminified development build
(~64k lines); a production wp-scripts build is 235 KB minified. Regenerate
dist/popup.{js,css} and the synced Safari Resources copies via
`npm run build:safari`, and drop the stale popup.js.LICENSE.txt under the
Safari Resources dir that the wp-scripts build no longer emits.
No source changes; this only corrects the shipped artifacts so the repo
stops carrying an oversized dev bundle.
Co-Authored-By: Claude <[email protected]>
jakemgold
approved these changes
Jun 6, 2026
Collaborator
jakemgold
left a comment
There was a problem hiding this comment.
Verified end-to-end: all five test-plan steps pass (npm install, build, smoke.js, package:chrome, build:safari), plus manual smoke testing in Chrome and Safari. Added a follow-up commit replacing the committed dev-build dist/popup.js with the production-minified bundle (~64k-line diff reduction).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replaces
10up-toolkitwith@wordpress/scriptsas the bundler for the popup.Why
I used toolkit in the beginning because it was just the tool I was the most familiar with. But with this living under the @WordPress org now we should use the default wp build tooling.
Details
webpack.config.jsthat layers two extension-specific tweaks on top of the wp-scripts defaults:popupbundle plus the dev-onlypreviewbundle used bypopup/preview.html.DependencyExtractionWebpackPluginfiltered out — wp-scripts assumes@wordpress/*packages are available on thewp.*global at runtime (true inside wp-admin, false in a browser extension), so we bundle them intopopup.jsinstead.dist/sopopup.html,sync-safari.sh,package-chrome.sh, and the Safari Xcode project keep working without path changes.buildfiles.config.js,filenames.config.js,paths.config.js) and thepopup.js.LICENSE.txtartifact (wp-scripts' Terser config strips license comments and doesn't extract them to a sidecar file)..gitignoreto silence wp-scripts' unused auxiliary output (dist/*-rtl.css,dist/*.map) — popup.html doesn't reference them and the Chrome zip / Safari sync don't copy them.build/startscripts keepcross-envto forceNODE_ENV, becausewp-scripts buildonly sets it when unset and a contributor's shell may already haveNODE_ENV=developmentexported.Production bundle size: 397 KB minified for
popup.js(down from 1.8 MB under 10up-toolkit).Test plan
npm installnpm run buildproducesdist/popup.{js,css}anddist/preview.{js,css}node test/smoke.js— all assertions passnpm run package:chromebuilds a Chrome zip with the expected layout (popup + dist + lib + icons + manifest)npm run build:safarisyncs into the Xcode Resources directory without errors